Reputation: 954
To respect SEO directives, I want to redirect all traffing coming from:
http://www.mywebsite.com
http://mywebsite.com
www.mywebsite.com
mywebsite.com
to
http://wvw.mywebsite.com/index.html
At the moment I use this code, but it doesn't work properly:
RewriteCond %{HTTP_HOST} !^www.mywebsite.com$ [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [L,R=301]
RewriteRule ^$ index.html [L].
All works, but still doesn't redirect to www.mywebsite.com/index.html
in case of www.mywebsite.com
.
Upvotes: 0
Views: 122
Reputation: 5331
Do this work
RewriteCond %{HTTP_HOST} !^www.mywebsite.com$ [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [L,R=301]
Upvotes: 1