Again, Google says this:
https://support.google.com/webmasters/answer/139066?hl=en
Avoid errors: 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
).
For example’s sake, these are their URLs:
http://example.com/wordpress/seo-plugin/
http://example.com/wordpress/seo/seo-plugin/
This is what rel=canonical
was invented for. Especially in a lot of e-commerce systems, this (unfortunately) happens fairly often, where a product has several different URLs depending on how you got there. You would apply rel=canonical
in the following method:
You pick one of your two pages as the canonical version. It should be the version you think is the most important one. If you don’t care, pick the one with the most links or visitors. If all of that’s equal: flip a coin. You need to choose.
Add a rel=canonical
link from the non-canonical page to the canonical one. So if we picked the shortest URL as our canonical URL, the other URL would link to the shortest URL like so in the <head>
section of the page:
<link rel="canonical" href="http://example.com/wordpress/seo-plugin/">
That’s it. Nothing more, nothing less.