Forum Moderators: phranque
I have a VirtualHost set up that has the servername of xyz.com and a bunch of ServerAliases. The goal of these rewrites I implemented was to redirect people from the other domains to the main one. I've implemented this and it's working, but I'm running into the problem of having double slashes.
I'm doing this directly in the VirtualHost container, and not in .htaccess.
Here's the rewrite code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^www.example.net$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^example.net$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.abcnet.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^abcnet.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.abcnet.net$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^abcnet.net$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^my.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
What do I need to change or add to remove the double slashes from happening?
Thanks in advance!
[edited by: jdMorgan at 10:03 pm (utc) on Sep. 13, 2007]
[edit reason] example.com [/edit]