kotarski.co.uk

Home arrow Articles arrow The Canonical URL
The Canonical URL

When you buy a domain you may well decide that a .co.uk domain is what you want. To be on the safe side you buy the equivalent .com domain at the same time.

So now you own domain.co.uk and domain.com. Ok that's easy you just forward domain.com to domain.co.uk. Easy, job done!

Maybe not quite as we shall see later on.

Ok so how do you want to refer to your domain? Is it:
domain.co.uk
or
www.domain.co.uk?

It's just a choice. There isn't a right or wrong answer but it does matter that only one is used.

For the sake of argument let's choose domain.co.uk

Unless your webserver is set up badly a reference to www.domain.co.uk will result in the same page being displayed as a reference to domain.co.uk. But for people compiling stats of accesses to websites thse two are different domains. In the worst case where exactly half of your visitors use one form and the other half use the other form it will appear that your website is half as popular as it actually is. This situation is compounded by the existence of domain.com and it's twin www.domain.com.

Duplicate Content Penalty 

Actually it's worse than that because Google applies a penalty if content on your website is largely the same as other websites across the internet or even your own site. Having several domains pointing at the same content counts as duplicate content in this context.

Canonical URL 

The primary domain that we want to use is known as the Canonical Domain or Canonical URL. In our case it is domain.co.uk. This is the domain that we advertise, place in email signatures and get people to use in links.

The way to avoid this problem is to rewrite the incoming domain to be the one that we want. We do this through the use of a permanent redirection (a 301 status report). How this works is that the incoming domain www.domain.co.uk gets rewritten as domain.co.uk and the web browser or serach engine spider is told that domain.co.uk is the one to remember. What about domain.com? The same happens here www.domain.com and domain.com are permanently redirected to domain.co.uk.

The details differ depending on which webserver you are using but if you are using the Apache webserver the following needs to be added to the .htaccess file in the root of your website:

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

To be continued.

Trackback(0)
Comments (0)Add Comment

Write comment

busy
Last Updated ( Thursday, 11 January 2007 )
 
Joomla Templates by JoomlaShack Joomla Templates by Compass Design
toxic-precision