Do canonical links require a full domain?

Richard picture Richard · Dec 11, 2011 · Viewed 17.7k times · Source

I want to add canonical links to my pages, but do I need to specify the domain, or will a relative URL do?

In other words, is:

<link rel="canonical" href="/item/1">

good enough, or do I need to use:

<link rel="canonical" href="http://mydomain.com/item/1">

Answer

Remy picture Remy · Dec 11, 2011

Directly from Google:

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394

Can the link be relative or absolute?
rel="canonical" can be used with relative or absolute links, but we recommend using absolute links to minimize potential confusion or difficulties. If your document specifies a base link, any relative links will be relative to that base link.