What does it do?
A canonical URL tells search engines that certain similar URLs provide the same content. This prevents duplicate content issues.
The rel=canonical HTML anchor attribute, often called the “canonical link”, is an HTML element that helps prevent duplicate content issues. It does this by specifying the “canonical URL”, or the “preferred” version of a web page, typically the original content source. Removing duplicate content with a canonical URL helps improve a site's SEO.
When and how should I use it?
This feature is useful when a site has multiple delivery domains. For example, if the site
www.example.com has the delivery domain
delivery.example.com, both will have <link rel="canonical" href="
https://www.example.com/" /> in their HTML markup, which prevents duplicate content between different domains.
If your site has the same content on similar pages, then you should use EdgeRules to add a canonical header to prevent an SEO penalty. Find more details at https://support.stackpath.com/hc/en-us/articles/360001445283-EdgeRules-Adding-a-Canonical-Header.
For example, assume you have the following two URLs that have the exact same content:
<link rel="canonical" href="https://www.example.com/products/productname/>" to
https://www.example.com/?prodID=38 should solve any SEO issues that arise with these two pages having duplicate content.
This has the effect of “mergeing” the two pages into one from a search engine’s perspective. It’s a “soft redirect”, without redirecting the user. Links to both URLs now count as the single, canonical version of the URL.