Google Webmaster Central Blog - Official news on crawling and indexing sites for the Google index

Supporting rel="canonical" HTTP Headers

Friday, June 17, 2011 at 1:05 AM

Webmaster level: Advanced

Based on your feedback, we’re happy to announce that Google web search now supports link rel="canonical" relationships specified in HTTP headers as per the syntax described in section 5 of IETF RFC 5988. Webmasters can use rel="canonical" HTTP headers to signal the canonical URL for both HTML documents and other types of content such as PDF files.

To see the rel="canonical" HTTP header in action, let’s look at the scenario of a website offering a white paper both as an HTML page and as a downloadable PDF alternative, under these two URLs:

  • http://www.example.com/white-paper.html
  • http://www.example.com/white-paper.pdf

In this case, the webmaster can signal to Google that the canonical URL for the PDF download is the HTML document by using a rel="canonical" HTTP header when the PDF file is requested; for example:

GET /white-paper.pdf HTTP/1.1
Host: www.example.com
(...rest of HTTP request headers...)
 
HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <http://www.example.com/white-paper.html>; rel="canonical"
Content-Length: 785710
(... rest of HTTP response headers...)

Another common situation in which rel="canonical" HTTP headers may help is when a website serves the same file from multiple URLs (for example when using a content distribution network) and the webmaster wishes to signal to Google the preferred URL.

We currently support these link header elements for web search only. As we see how webmasters are using these elements, we're hoping to add support for them in our other properties. For more information, please see our Help Center articles about canonicalization and the rel="canonical" element. If you have any questions, please ask in our Webmaster Help Forum.

The comments you read here belong only to the person who posted them. We do, however, reserve the right to remove off-topic comments.

27 comments:

Stecki said...

Wouldn’t the example better be signaled as rel="alternate"?

Sebastian said...

See, nagging since 2009 works!


Thank you!
Sebastian
http://sebastians-pamphlets.com/x-canonical-uri-http-header/

Ian said...

This is fantastic news - something I've been hoping for since ... well at least September 2009! http://goo.gl/MX

Really interested to see how well this works in practice.

Noah Beal said...

Yay! Good job GoogleBots.

GaryTheScubaGuy

Anupam Karaiya said...

Hi,

Fantastic news!!

I will use this today

gustavo.parra said...

Excellent news, I have been struggling with dup content in colleges websites the publish huge ammount of content on pdf´s.

clinic17plus said...

how showing ....

Tuf said...

Great news. The question is now if "Google" will see the real url faster, now that it is seen earlier

dominalafatigacronica said...

Yo me he sorprendido al recibir un email de parte de google informandome que uno de mis webs no ha sido actualizada a la nueva version de wordpress.
Realmente es excelente servicio.

Krish Purnawarman said...

cool stuff, but as you know, like its sister canonicals, does link rel canonical leaves open for Google to decide which result it wants to use. In this case, is it still possible for Google to prefer the PDF version instead of the html/ php version? . I cant think of any reason why a PDF version would be more preferable than its html counterpart,

thanks
regards

Krish Purnawarman

Kalpesh Patel said...

Until Adobe do not give option to add canonical attribute, how one can add canonical in PDF file?

unleash said...

Do canonical mechanism really help a website to come on top.

Unleashpm.com

Merda pelo mundo said...
This comment has been removed by the author.
askbangladesh said...

I think this new logic add to the google. Thats a great Job.

Charles Liu 刘明 said...

is it helpful to put 'canonical' into binary file's http header?

Charles Liu 刘明 said...
This comment has been removed by the author.
the.jokerim said...
This comment has been removed by the author.
Blogs said...

good work

Jobsie said...

This header is particularly useful when using a CDN so rolling it out to rich media searches like image and video search search should be considered a priority.

2medicure said...

Great help most of the people worried about canonical url this is proper solutions for it.

DimitriAu said...
This comment has been removed by the author.
滄月之東 said...

I wonder if other search engines (like Bing or Yahoo) support Cross-Domain Canonical tag or not.

If the answer is not, what can we do without 301 redirect (cause the policy of Google Adwords doesn't allow 301 redirect for landing page).

Vishal Agrahari said...

hey can we use canonical tag for shortening url. i have a page which have big url which user can not share so i wanted to make it short thru canonical. I link to that page which is not existing for e.g.

link rel="canonical" href="http://www.example.com/abc"/ for page which have url http://www.example.com/abc?xyz/a/1/.../abc.html

looking for info

Mike Jagger said...

Really interested to see how well this works in practice.

sefati said...

how nice! I actually suggested this to someone and a self proclaimed SEO expert called me a hack!!!!

Васил Тошков said...

There is a Content-Location HTTP Header for that purpose. Why can't I use is?

cindy.krum@bluemoonworks.com said...

Our server removes the 'http://' and just leaves 'www.' when pages render in a browser, so does that mean that the canonical tag should remove it too? Do you have to include the 'http://' in a canonical tag if it is not actually the canonical url that is rendered in the browser?

Is this ok?

<link rel="canonical" href="www.asite.com" since that is what shows up in the browser...

Or do we have to still put <link rel="canonical" href="http://www.asite.com" in the canonical tag?

Or does it not matter at all?