I just noticed that Google support's Consolidate duplicate URLs - Search Console Help says:

Use absolute paths rather than relative paths with the rel="canonical" link element.

Use this structure: https://www.example.com/dresses/green/greendresss.html
Not this structure: /dresses/green/greendress.html

I've always used simply the filename, without extension, as in:

public/Recipes/Mushy_Peas.xhtml:   <link rel="canonical" href="Mushy_Peas" />

without any obvious problem reported in Google's webmaster report pages, which reports:

User-declared canonical https://rbutterworth.nfshost.com/Recipes/Mushy_Peas

Using the stripped filename is a lot easier than entering the entire URL.

(Note that there aren't multiple URLs to the page, other than with/without the ".html" suffix.)

Is there any reason to change this (and a few hundred others) to be the full URL?

  • Welcome to Webmasters! You are fine. Googles point is to include the entire URL including the domain name otherwise the canonical link becomes useless in cases like if someone copies your page.
    – closetnoc
    Commented Oct 7, 2019 at 1:28

1 Answer 1


The point of using a canonical URL is to establish the specific URL you want to rank for and therefore avoid duplicate content. If you use a relative URL as a canonical, multiple options can still be used.

Let's put an example, for the relative URL /dresses/green/greendress.html those would be the options:

  • http://example.com/dresses/green/greendress.html
  • http://www.example.com/dresses/green/greendress.html
  • https://example.com/dresses/green/greendress.html
  • https://www.example.com/dresses/green/greendress.html

So an absolute path is a must to make sure canonical works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.