Why canonical URLs exist.
A page can become accessible through several addresses without anyone intentionally creating “duplicate content.” Tracking parameters, filters, print views, HTTP and HTTPS variants, trailing-slash differences, uppercase paths, syndication and CMS behaviour can all generate alternative URLs.
Search engines cluster pages whose primary content is duplicate or very similar, then select one representative URL. That selected page is the canonical. The process helps avoid showing multiple nearly identical results and consolidates signals around one address.
A canonical tag does not delete a duplicate page. It identifies the URL you prefer to represent a cluster.
Simple example
These addresses may show the same product:
https://example.com/shoes/blackhttps://example.com/shoes/black?utm_source=newsletterhttps://example.com/shoes/black?sort=popular
If the clean URL is the preferred version, each duplicate can point to it.
<link rel="canonical" href="https://example.com/shoes/black">How to implement rel=canonical.
Place one canonical link element inside the document’s <head>. Use an absolute HTTPS URL and point to the page that should represent the content.
<head>
<title>Example page</title>
<link rel="canonical" href="https://example.com/preferred-page">
</head>Self-referencing canonical
An indexable page can point to itself. This makes the preferred form explicit and helps when parameters or alternate paths reproduce the same content.
<link rel="canonical" href="https://www.totaldizajn.com/blog/what-is-canonical-url.html">Canonical HTTP header
For non-HTML resources such as PDFs, a canonical can be sent through the HTTP Link header.
Link: <https://example.com/preferred-document>; rel="canonical"Redirect, canonical tag or sitemap?
Choose the method that matches what users should experience. A permanent redirect is appropriate when the old URL should no longer remain available. A canonical tag is appropriate when alternate URLs must remain accessible. Sitemap inclusion reinforces which URLs you consider canonical, but it is a weaker signal.
