View Single Post
Old 09-03-2012, 10:46 AM   PM User | #3
fine0023
New Coder

 
Join Date: Sep 2011
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
fine0023 is an unknown quantity at this point
I was wondering if it is necessary to keep all of this code in my htaccess....because I have www.mydomain.com set as my hard canonical name, which I think is supposed to redirect aliases such as mydomain.com automatically (without having to code anything in htacess). However, I don't think this has anything to do with redirecting index.html to the non-index.html url. Would it make sense to take out the first part:
Code:
#if the domain is not www.mydomain.com
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$ [NC]
#redirect to www.mydomain.com
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
and leave in the second part:
Code:
#leave this rule in place, but after the one above to handle the home page
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ 
RewriteRule ^(.*)index\.html$ http://www.mydomain.com/$1 [R=301,L]
?
fine0023 is offline   Reply With Quote