Thursday, March 4, 2010

Drupal and Canonical Urls

In Google each unique URL is indexed as a separate page. So if we have a URL: http://www.mysite.com/my-page-1 and http://www.mysite.com/my-page-1?page=3 will be indexed as separate URLs! This is a disadvantage as Google thinks we are trying to duplicate content and have multiple URLs to the same HTML content.

This is reflected in the Google Webmaster, under Diagnostics - HTML suggestions. In the webmaster HTML suggestions google points out that URL: http://www.mysite.com/my-page-1, http://www.mysite.com/my-page-1?page=3 have the same title tag. Each URL in our site should have a unique title tag.

To address this we can add a meta information in our page headers to inform Google that our main parent URL is http://www.mysite.com/my-page-1, and all clicks to any other '?page links' to be added to the parent URL. This is done by using Google's Canonical meta tags, refer:http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html, http://www.mattcutts.com/blog/seo-advice-url-canonicalization/

The Canonical meta information on our http://www.mysite.com/my-page-1?page=3  page should be: href="http://www.mysite.com/my-page-1" rel="canonical" inside link Tag.

It's not sufficient to enable Clean URL and Path auto, Global redirect modules. We must also configure our comments, View pagination, Page pagination, Auto title CCKs to have appropriate Canonical URLs to avoid getting penalized for Duplicate content and improve our site ranking.

Canonical URL integration is available in Drupal 6.0 Meta module. In Drupal 5.x there is no ready made integration. You can embed a small piece of code in the template file to achieve the same.