Forum Moderators: phranque
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} !^localhost
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]. Alas, some folks have set links to a subdirectory of mine using http*//example.com/bar , but the correct canonical URL would be http*//www.example.com/bar/
So, currently, there is a double redirect
1) http*//example.com/bar => http*//www.example.com/bar
2) http*//www.example.com/bar => http*//www.example.com/bar/
Any simple way to get a single 301?
Cheers
bull
[edited by: jdMorgan at 3:26 pm (utc) on May 26, 2006]
[edit reason] example.com [/edit]
RewriteRule ^bar$ http://www.example.com/bar/ [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com¦localhost)
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Jim