SEO Geek: rel=canonical for HTTP Headers

Posted on

  • email
  • twitter
  • facebook
  • share this

share this

Several weeks ago Google announced support for link rel="canonical" relationships specified in HTTP headers as per the syntax described in section 5 of IETF RFC 5988. 

Editors Note: As a quick aside, Website Magazine will feature a very practical article from Prashant Puri on canonicalization in the Small Business Lab column of our September issue. 

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. For example, perhaps you have a white paper as an HTML page and as a PDF using two URLs - and SEO's 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.

So how do you apply it?
If you’re using, Classic ASP or PHP web pages, here’s how:

ASP.Net C#:
<%Response.AddHeader(@”Link”,@”<>; rel=”"canonical”"”);%>

<%Response.AddHeader “Link”,”<>; rel=”"canonical”"”%>


<?php header(“Link: <>; rel=\”canonical\”");?>

When the web page is requested the server will respond with a 200 status as well as the link header telling Google that the page is a canonical of the URL specified.

Google provided another instance when this might come in handy. For example, serving the same file from multiple URLs (common if using a content distribution/delivery network). The rel=canonical HTTP header could be used to signal to Google the preferred URL. 


Filed under: , ,

Login To Comment

Become a Member

Not already a part of our community? Sign up to participate in the discussion. It's free and quick.

Sign Up

Be the first to comment on this article

999 E Touhy Ave
Des Plaines, IL 60018

Toll Free: 1.800.817.1518
International: 1.773.628.2779
Fax: 1.773.272.0920