Help with canonical URL problems

  • Thread starter OnlineMenusCornwall
  • Start date
O

OnlineMenusCornwall

I've got to admit I really haven't got my head around what this exactly means but apparently my website "likely has canonical URL problems. For instance, you may have the same content on http://www.url.com, http://url.com, and http://www.url.com/index.html."

Could someone please explain to me how I can check and fix this?

Thanks in advance.
 
F

Faevilangel

Create a file called .htaccess in your file panel and then add the following code

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.co.uk [NC]
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [L,R=301]
</IfModule>

An extra code line which is handy is redirecting your index.html to the root which you add to the above code before the </ iIfModule >

Code:
RewriteRule index\.html http://www.domain.co.uk/ [NC,R]
 
Upvote 0
O

OnlineMenusCornwall

I'm still struggling to get this sorted guys. Any help appreciated.

Do I need to tell Google in Webmaster Tools which domain I prefer?

This is my current htaccess file....

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.co.uk [NC]
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [L,R=301]
ErrorDocument 404 /errors/404NotFound.php
</IfModule>

I'm not convinced this is right as Woorank gives me the following message...

Be careful! Your website without www doesn't redirect to www (or the opposite). It's duplicate content!

Any ideas?
 
Upvote 0

Latest Articles

Join UK Business Forums for free business advice