Search code examples
htmlseocanonical-linkhtml-head

Do canonical links require a full domain?


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">

Solution

  • 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.