The Importance of Canonical URL’s

|

What is url canonicalization?

“Canonicalization is the process of picking the best url when there are several choices”1 This is done by Google-bot and helps reduce the number of pages in the search engines index in turn making Google search better. This in most cases refers to the home url or homepage. Google-bot will be presented with the following urls with no instruction on which one is the main url to index.

  • www.example.com
  • example.com/
  • www.example.com/index.html
  • example.com/home.asp

So with so many different urls pointing to the same page, Google try’s to choose the best URL. But in some cases it fails and indexes the wrong URL, leaving your Google serp listings without the “www” or in some cases not indexing entire sections of your website.

There is a solution for this. It involves getting you hands dirty in code but it lets Google know exactly what your url is.

It involves a bit of server code and looks like this.

RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*) http://www.example.com/$1 [R=301,L]

This bit of code is placed in the ‘.htaccess’ file and performs a 301 redirect. So that what ever url you type into your browser that refers to your domain will redirect to ‘www.example.com’. This gets rid of the of the old URLs and ensures your correct url is always displayed. This basically rewrites non-www domains into www domains across your entire domain.

References:
Matt Cutts (http://www.mattcutts.com/blog/seo-advice-url-canonicalization/)

Leave a Reply

Your email address will not be published. Required fields are marked *