Removing double forward slashes from URL with Apaches mod_alias module

I am looking to install the mod_alias to help with a htaccess rule to prevent duplicate content.

# Remove double forward slashes
<IfModule mod_alias.c>
    RedirectMatch 301 ^//(.*)$ http://example.com/$1
</IfModule>

When I check easyapache I see this module is available: Apache Module mod_vhost_alias

I am looking to add this module to apache: mod_alias

They do not seem the same however?

Tagged:

Comments

  • These two modules doesn't appear to be the same, no. I do believe mod_alias to be running by default.

    You can run this shell command as root to check yourself:

    [root@server~]# httpd -M | grep alias
     alias_module (shared)
    
Sign In or Register to comment.