Canonical URLs and how to avoid them using redirects.


04.28.07 Posted in Search Engine Optimisation by Barry

Some­times if domains are incor­rectly setup, the domain urls www​.domain​.com and domain​.com are con­sid­ered by search engines as sep­a­rate pages. As both pages are indexed by search engines, you may be penalised for dupli­cate con­tent (bad).

To avoid this, you can redi­rect all traf­fic to one stan­dard URL, a canon­i­cal URL. Canon­i­cal means ‘stan­dard’ or ‘authoritative’

I’ve imple­mented two sim­ple meth­ods around this.

1. Mod Rewrite in .htaccess

This is apache server spe­cific, cre­ate or amend your .htac­cess file with

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

This enables the Rewrite Engine (line1) while a con­di­tion on line2 comes into play when peo­ple access bar​ry​hand​.com , this is also case sen­si­tive [NC]

The 3rd line redi­rects to www​.bar​ry​hand​.com using a per­ma­nent 301 redirect

2. Google Pre­ferred Domain

Google allows you to con­trol your pre­ferred domain from their excel­lent web­mas­ter tools sec­tion. A whole host of good­ies and stats are also avail­able once you ver­ify your site ownership.

Enabling both these meth­ods will assist in search engine opti­mi­sa­tion , for more infor­ma­tion see here -

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon


blog comments powered by Disqus