I've have getting hints on the internet that one should prevent having multiple URLs of the index page as in the following: http:/website.com http:/www.website.com http:/www.website.com/ http:/www.website.com/index.html http:/website.com/index.html What would i have to do in order to have all listed URLs pointing to http:/website.com/, and is the URL I've selected the best? thanks in advance.
I have the following in my .htaccess file would it do the trick? RewriteEngine On RewriteCond %{HTTP_HOST} !^website.com$ [NC] RewriteRule ^(.*)$ http://website.com/$1 [L,R=301]
That first part would redirect everything that is not website.com to website.com which would make: www.website.com => website.com www.website.com/index.html => website.com/index.html www.website.com/somepage.html => website.com/somepage.html In order to redirect index.html to / you will also need: RewriteRule ^index\.html$ / [R=301,L] Code (markup): website.com and website.com/ are already seen as the same thing.