How To Fix Common Canonicalization Issues

Canonicalization is a common issue that effects many websites, which can be having a negative impact on your websites’ rankings.

Canonicalization basically occurs when the same content is available via different URLs, for example, visitors could find your website via http://www.example.co.uk and http://example.co.uk.

Resolving Canonicalization issues is important for your website, but why?

  • It Prevents multiple URLs for same content on your website
  • It Prevents the dilution of lany ink juice/equity to the same content
  • It allows you to choose your prefered URL of a particular piece of content
  • How to resolve Canonicalization issues

    There are essentially two methods available to you to resolve these issues, these are via 301 redirects, or by using the link rel=”canonical” tag within pages.

    301 Redirects

    A 301 redirect essentially tells search engine spiders and your visitors that a page has been permanantley moved to a new location. Users will automatically be re-directed to the new page (or domain name), while search engines will also be able to update their index and pass *almost* all of the link juice/equity given to the former location.

    Resolving Non www Vs www version of a website

    A common issue with websites is that both the non www. and www. version of websites are active, meaning that any inbound links to these are going to be seen as going to seperate pages! If you have an Apache server, add this code into your .htaccess file

    RewriteEngine on
    rewritecond %{http_host} ^example.co.uk [nc]
    rewriterule ^(.*)$ http://www.example.co.uk/$1 [r=301,nc]

    Resolving the trailing slash Vs the index file URL

    Another common issue is the trailing slash versus the index file URL versions of the page,which again are going to be seen as seperate pages, as shown here:

    http://www.example.co.uk/directory/

    http://www.example.co.uk/directory/index.html

    This issue can be fixed with one line in your .htaccess file using a redirectmatch command, which will match any instance where the redirect is supposed to occur sitewide!

    RedirectMatch 301 ^/(.*)/index\.html$ http://www.example.co.uk$1

    While we’re speaking about 301 redirects, here are some other common 301 examples you may find useful:

    Redirecting Old Pages To New Ones

    If for any reason your pages’ url’s have changed (such as if you have had a new CMS for your website) you can tell your visitors and search engines the new address of the page they were looking for.

    Redirect 301 /oldpage.html http://www.example.co.uk/newpage.html

    If you would like to simply Redirect an entire website to a new single address:

    redirect 301 / http://www.example.co.uk/

    *Make sure that you include the full URL of the new location as above*

    Redirecting Dynamic Pages:

    A dynamic page is one generated by a database driven application, such as blog. A file name is appended by a query string, looking something like this:

    http://www.example.co.uk/page.php?id=7

    When a query string is used, the 301 redirect solution for static pages as above will not work and you’ll need to use a rewrite solution. Using the page.php?id=7 example, you’ll need to use in your htaccess file:

    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^id=7$
    RewriteRule ^/page.php$ http://www.example.co.uk/newname.htm? [L,R=301]

    Rel Canonical Link Tag

    In February 2009, Google announced that they were accepting a new form of the link tag that would help website owners with canonicalization issues.

    The element is rel=canonical.

    For example, if you have two pages of content that are now out dated or very similar and you want to specify the version of the page you prefer, you could add this tag to the of the pages that you dont want to be the canonical URL of your content

    such as

    http://www.example.co.uk/outdated-page-1

    http://www.example.co.uk/outdated-page-2

    This tells the search engines (Google & Yahoo!, Bing doesn’t appear to follow it) that these URLs all refer to the canonical page at

    http://www.example.co.uk/updated-page-address

    It’s also worth mentioning that Google also accepts canonical links between domains as well. Which is very important for websites that sell content to other companies (such as classifieds portals displaying their content on local websites).

    Further Reading:

    Google’s help page on Canonicalization

    More information on Apache .htaccess files

    Share and Enjoy:
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • StumbleUpon
    • Yahoo! Buzz
    • Reddit
    • Propeller
    • Print this article!
    • E-mail this story to a friend!

    Leave a Reply