Implement rev=”canonical” and become supercool

In the hope of looking supercool I have decided to jump on the rev=”canonical” bandwagon and implement short urls on this site. I am sure that you will also want to bask in the glory of doing something so ground-breaking and undeniably impressive so I have kindly shared my experience with you. Please read the rest of this post first and then thank me profusely in the comments.

Is rev canonical a type of vicar?

Nope. rev=”canonical” involves specifying a shorter url for each of your web pages so that people don’t have to rely on 3rd party sites like tinyurl to shorten your urls. Over the last week the whole idea has sprung out of nowhere and there are various great blog posts explaining what rev=”canonical” is, why it might possibly be completely flawed, and why it might just help save the internet!

Implementing rev=”canonical”

Fortunately for me the url of this site is quite short so I didn’t need to buy a new domain for the purpose. I was also lucky that the text in the 2nd segment of my blog posts is completely arbitrary and purely there for SEO, usability and decorative purposes. All these urls for example all link to the same blog post:

Without making any other changes then I can use the format of the last example url for my shorter urls.

Correct rev=”canonical” syntax

Now I have the format of my preferred short urls I can move on to specifying this on each individual page. Currently the syntax for doing this is:

<link rev="canonical" href="" />

As I have put the rev=”canonical” into the link element it must therefore live in the HEAD of my html.

The future of rev=”canonical”

Using the rev element in this context has been critised for being semantically incorrect, furthermore it is planned to be depreciated in HTML5. It is very likely therefore that I will need to make some changes to my implementation. As Drew McLellan rightly points out however:

You don’t need to worry about early adopters – early adopters are smart enough to worry about themselves. Something that takes 5 minutes to implement only takes 2 minutes to change, if necessary.

Some possible future developments for this concept include using http headers and proposals for more semantic syntax eg:

<link rel="alternate shorter" href="" />

In the future I might also consider making the urls even shorter with one of these options:

His holiness the Reverend Canonical in action

It amazes me how quickly people react to new developments and a cracking example is the speed at which Simon Williams has put out a bookmarklet which automatically fetches the short url for a page if it has been specified otherwise creates one for you. So go on, try it out drag this Shorten Bookmarklet into your bookmarks toolbar and give it a try.

Unfortunately implementing this on my site has not saved the internet nor has it made me supercool. However I hope that if more people show their support for it some of the teething issues can be resolved and it will help improve the web just a tinyurl little bit.

3 Responses to Implement rev=”canonical” and become supercool

  1. John says:

    I think you have missed the point – you should be making your urls bigger not smaller! 😉

  2. As you’ve got loads of URLs that point the same content, you might consider bunging @rel="canonical" in there too, for SEO reasons.

    I had a crack at running a blog of yours through and it seems to work!

  3. Russell says:

    Yeah good point Ciaran, previously I had not been too worried about duplicate urls for the same content but now I am explicitly offering an alternatives it makes perfect sense to add rel="canonical" too.

Leave a Reply

Your email address will not be published. Required fields are marked *