Forum Moderators: phranque
I wish to permanent redirect the [mydomain.com...] page to [mydomain.com...] root.
I am using following in the .htaccess
Redirect 301 /index.html [mydomain.com...]
but it goes into a loop. Can you please point out what is wrong and what could be the exact command or rule.
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]\
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
to redirect non www to www.
Now I have added this line
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]
But it still goes in a loop.
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . http://www.example.com%1/%2 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]\
Perhaps Jim could chime in if you continue to have problems.
Peter