on June 17, 2011, Google announced their support for rel=”canonical” HTTP headers. This can come in handy if you see duplication of content across different file types. It basically allows webmasters to assign a file a rel=canonical tag that references an HTML document as the real (canonical) URL. This tag will be very helpful for many websites out there that currently offer the information on their HTML web pages as a downloadable PDF. For instance, a power tool company may be offering information on Air Wrench User Guide as both an HTML page and as a downloadable brochure in PDF format:
In this instance, with both files serving up the same content, a sever-side canonical tag could be applied.
All very well and good, but how do you apply it? If you’re using ASP.net, Classic ASP or PHP web pages, here’s how:
<%Response.AddHeader(@”Link”,@”< http://www.yoursite.com/>; rel=””canonical”””);%>
<%Response.AddHeader “Link”,”< http://www.yoursite.com/>; rel=””canonical”””%>
After you modified the server HTTP header, next time 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.