SEO & GEO·2 min read

Canonical tag now available in the HTTP header

Not many days ago, Google officially introduced support for the canonical meta tag via the HTTP headers. Now, for those who don’t know what a canonical tag is, in a very short sentence it is an HTML tag that allows webmasters to specify which URL of a page should be stored in the index.

Why is using the meta tag rel=canonical important?

Well, there could be different reasons, but the most important is of course to avoid duplicate content, a topic Google has been hammering quite a lot recently.

However, before this change, due to technical limitations the meta tag usage was restricted to web pages made purely of HTML. But we all know that content can also be a media file like a video or a PDF. And how many times have you seen the same file hosted more than once on a website due to mistakes?

I’ve personally seen this quite a lot, especially with those companies that aim to publish their timetables both as an HTML file and a PDF, without adding any extra value through that choice.

From now on, by “hacking” the HTTP header returned from the server for those files, you’ll be able to specify which version of the document needs to be indexed.

Duplicate content is bad

Duplicate content is quite a big issue on the web, and search engines are dramatically removing duplicate resources from their index to offer a better experience of the web.

On more than one occasion I’ve come across customers who absolutely want their content published in PDF as well. They believe that adding a couple of nice (I would say ridiculous) pictures to their Word document makes them the best designers in the world.

As a consequence, in order to make those (often irritating) customers happy, you have to comply with them, generating issues on their site.

Implementing rel=canonical at HTTP request level is a great chance to make both parties happy.

At the moment there is no evidence Bing is going to support the tag, so bear in mind that, although this is a solution, Bing will continue to consider your documents duplicates.

How can I implement the rel canonical tag via the HTTP headers?

Implementing the canonical tag can vary according to the hosting platform. In a *NIX environment it is of course easier, as you ultimately need to change a text configuration file accessible even via FTP.

As this implementation requires you to be very specific while targeting the files, an example could be

`` Header set Link "http://www.mydomain.com/myfile.html; rel="canonical"" `

Also, be aware that any change to the .htaccess file can seriously compromise the whole website’s visibility if you make a mistake.