Creare SEO homepage
0800 01 999 06

What to expect, when you’re expecting…A penguin.: Since its mention in march, there has been much speculation ... http://t.co/iXg6OqJYTr

SEO Video Blog – Canonical Link Element #44

Welcome to this weeks SEO video blog, We are going to return to canonicalisation and how to correctly implement the canonical link element.

The principle behind canonicalisation link elements is to normalise your URL’s, this then helps search engines decide which of your pages is the authority for a particular piece of information and also allows Google to direct any link juice to the correct URL helping you search engine positions.

These can be important for content management systems and eCommerce website that generate identical pages with different URL’s. We have previously done a more in depth video on canonicalisation and webmaster tools blog also have an excellent video with Matt Cutts from Google explaining the principles, both of these are linked from the supporting blog post.

We have created a simple piece of php code which allows your to canonicalise your website quickly and easily, this weeks tutorial will show the installation and you can get the code from the blog post.

The implementation on this dynamic canonical link element is for php apache servers, it will allow you to tell Google which page is the authority for the content displayed.

The code does this in 2 ways, firstly It shows the full domain ie. www.domain.co.uk, so you have no issue with Google treating domain.co.uk as the primary source of content. You can also specify this in webmaster tools or use a .htaccess file to re-direct.

Secondly, if you have folder on your server,  for example /downloads/canonical/ and you want this folder to be classed as the authority, you can use the code supplied.

<link rel=”canonical” href=”http://www.seo-creare.co.uk<?php echo str_replace(“index.php”, “”, preg_replace(“/\?[\w&\-\_\=]+/”,”",$_SERVER['REQUEST_URI']));?>” />

I have set an example on creare communications.

so we can see i have added the code to the header in my index.php file. Now when I upload the file and view the source of the index.php page, it displays within the canonical link element the URL /downloads/canonical/ and not /downloads/canonical/index.php, This means if Google finds this page it will automatically know that I want the origin of the pages content to lie with / and not index.php

We hope this helps you inform Google of your primary content and exclude any duplicate content issues, along with that it will help natural back links that are currently linked to the wrong URL to be re-directed to the canonical URL.

Thanks for watching if you have any questions or comment please leave them on the Youtube channel or supporting blog post.

http://www.seo-creare.co.uk/downloads/canonical/

Related Posts

Read more from:

4 Responses to “SEO Video Blog – Canonical Link Element #44”

  1. Web Traffic Says:
    March 31st, 2010

    Great video, and write up, canonical links do help a lot if used properly, especially on large sites that contain a lot of duplicate or semi duplicate content.

  2. aukseo Says:
    April 1st, 2010

    Hi Ant and Dec,

    Seems you have a problem, what happens if you request a canonical URL?

    If you use SERVER['REQUEST_URI'] you are getting the request URL rather then the URL you want the search engine to see

    ……so

    for example if you load up the page http://www.seo-creare.co.uk/downloads/canonical/?tracking=111

    the canonical will be

    http://www.seo-creare.co.uk/downloads/canonical/?tracking=111

    As you script is looking at the requested URL.

    Good job this script isn’t on your home page, you might lose your nice ranking on “SEO” due to a duplication.

    John

  3. Nick Says:
    April 1st, 2010

    Hi John,

    Good point, we have added a regular expression replace string to the code to stop that happening. see here:

    http://www.seo-creare.co.uk/downloads/canonical/?tracking=111&&id=jim-will_fixit&&

    With the sites that we build we use permalinks to re-direct parameters via a .htaccess file, hence why we don’t have the need for the canonical link element on crearecommunications.

    We have previously done a video blog on htaccess files or you can use this simple editor to create one for yourself.

    http://www.htaccesseditor.com/en.shtml#a_redirect

    Nick and James

  4. aukseo Says:
    April 9th, 2010

    Nice fix!

search the SEO blog

Monthly Archives