I'm trying to make it so that
http://www.site.com
http://site.com
http://www.site.com/index.htm
http://site.com/index.htm
all go to http://www.site.com/
My current .htaccess is as below. However, I've searched all over and can't seem to get the right config. While the rewrite rule properly adds the"www" to every version of the URL, the index.htm redirect causes an error in safari stating that too many redirects have occured. Any ideas on how to get around it?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [L,R=301]
redirect 301 /index.htm http://www.site.com/
http://www.site.com
http://site.com
http://www.site.com/index.htm
http://site.com/index.htm
all go to http://www.site.com/
My current .htaccess is as below. However, I've searched all over and can't seem to get the right config. While the rewrite rule properly adds the"www" to every version of the URL, the index.htm redirect causes an error in safari stating that too many redirects have occured. Any ideas on how to get around it?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [L,R=301]
redirect 301 /index.htm http://www.site.com/