Having learnt this i then jumped into my ht acccess file & added this line of code:
301 /index.htm http:[noparse]www.davidclick.com[/noparse]
But that didnt work in that an error warning -
âFirefox has detected that the server is redirecting the request for this address in a way that will never complete.â
So my question is please⌠âHow do i fix the canonical error two versio0ns of my home page is generatingâ
Footnote: I have noticed also each there is a <link rel=âcanonicalâ href=âhttp://www.davidclick.comâ/> on the home page & wonder if this could be cocking things up.
Take a look again at your command.
301 /index.htm http:[noparse]www.davidclick.com[/noparse]
First, I believe it should have the word Redirect in front of the 301, second, you are missing the slashes after the http:
Redirect 301 /index.htm [noparse]http://www.davidclick.com[/noparse]
[font=verdana]As cpradio says, youâre missing a // from your 301 line, but assuming thatâs just bad copying ⌠Iâm not entirely sure what the problem is. Your canonical link is exactly what I would expect to see, telling search engines that whatever route they have arrived at the page by you want them to index it as [noparse]www.davidclick.com[/noparse]. I wouldnât worry about any other redirects.
The problem with trying to use a redirect to get rid of the âindex.htmâ is that you end up in an infinite loop. When you ask for [noparse]www.davidclick.com (or any other URL that doesnât end with a filename), the server needs to give a page and so automatically appends âindex.htmâ (or whatever you have selected as your default filename) onto the end, and asks for www.davidclick.com/index.htm. The server then thinks âHmmm, I have to redirect that URL to www.davidclick.comâ and then it all goes round again.[/noparse][/font]
Aw, if the www and non-wwwâd domains are co-located (as they usually are), then the correct code above (cprado) will generate an endless loop. Thatâs where the power of mod_rewrite comes in: Check whether www or non-www and redirect the non-www to the wwwâd URL, i.e.,
RewriteEngine on
RewriteCond %{HTTP_HOST} ^davidclick\\.com$ [NC]
RewriteRule .? http://www.davidclick.com%{REQUEST_URI} [R=301,L]
All this is in the tutorial linked in my signature so Iâd recommend reading to know why this is the code (see Sample Code - force www) to use.