Canonical URLs
When the same content is reachable at multiple
addresses, search engines split ranking signals
across duplicates. Canonical URLs consolidate
indexing onto a preferred version through the HTTP
Link header with rel="canonical",
delivering the signal at the protocol level before
the HTML body arrives.
Usage
The same page often exists at several URLs. Protocol
variants (http:// vs https://), www and non-www
hostnames, trailing slashes, query parameters for
tracking or sorting, print-friendly versions, and
syndicated copies all create duplicate URLs pointing
to identical or near-identical content. Without a
canonical declaration, search engines decide which URL
to index on their own, splitting ranking signals across
the duplicates.
The rel="canonical" link relation names the
preferred URL. Search engines treat the declaration
as a strong signal for consolidating indexing, link
equity, and ranking signals onto the canonical URL.
Link: <https://example.re/page>; rel="canonical"
Three delivery methods exist: the HTTP
Link header, the HTML
<link rel="canonical"> element, and inclusion in an
XML sitemap. All three carry weight with Google. The
HTTP Link header is the focus here because the
header operates at the server level and reaches
crawlers before any HTML parsing begins.
Early signal delivery
The HTTP Link header travels with the response headers, so the canonical URL is available before any HTML parsing begins. Header-level delivery keeps the signal consistent across page templates and covers resources without an HTML head.
Consolidation itself is where the crawl efficiency lives. Pages behind query parameters, session IDs, or tracking codes often return the same content as the canonical. Once search engines settle on the canonical, they concentrate crawling there instead of recrawling every duplicate variant.
A server can also place the canonical Link header in a 103 Early Hints response, sent before the final response is ready.
HTTP/1.1 103 Early Hints
Link: <https://example.re/page>; rel="canonical"
Crawlers gain nothing from this today. Per public statements from Google's search relations team, Googlebot ignores the 103 interim response and waits for the subsequent final response. A canonical in an Early Hints response is a forward-looking option at best. The canonical needs to appear in the final response headers or the HTML to count.
Non-HTML resources
PDFs, images, downloadable files, and API responses
have no HTML <head> element. The HTTP Link header
is the only method for declaring a canonical URL on
non-HTML resources.
A PDF accessible at multiple URLs uses the Link header to point crawlers to the preferred version.
HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <https://example.re/report.pdf>; rel="canonical"
A common pattern is canonicalizing a PDF to its dedicated download page. The PDF itself is the raw file, but the download page provides context, metadata, and internal links. Pointing the PDF's canonical to the HTML download page consolidates indexing signals onto the page with richer content.
HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <https://example.re/reports/annual>; rel="canonical"
The download page at /reports/annual becomes the
indexed URL. The PDF stays accessible at its direct
URL but drops out of search results in favor of the
HTML page.
Server configuration handles this without modifying
the files themselves. Nginx add_header, Apache
Header set, and CDN edge rules inject the Link
header at the infrastructure level.
Cross-domain canonical
The rel="canonical" link relation works across
domains. The canonical URL exists on a different
hostname. Syndicated content, white-label pages, and
content distributed across partner sites use
cross-domain canonical to consolidate indexing signals
back to the original publisher.
Link: <https://original.example.re/article>; rel="canonical"
Cross-domain canonical is a strong consolidation signal. The target domain accumulates the ranking value from all syndication URLs pointing to the canonical. The syndicated copies still appear online but drop out of search results in favor of the canonical.
Conflict resolution
When the HTTP Link header and the HTML
<link rel="canonical"> element declare different
canonical URLs for the same page, the outcome is
unpredictable. Both methods carry equal weight as
signals. Search engines may follow one declaration,
the other, or ignore both entirely and select a
different URL based on other signals like
redirects, internal link patterns,
sitemap URLs, HTTPS preference, and
hreflang cluster membership.
Using one canonical method per page avoids ambiguity entirely. If server-level configuration sets a Link header canonical and the CMS injects a different HTML canonical, the mismatch hands the decision to the search engine with no guarantee about which URL, if either, wins.
Common mistakes
Missing self-reference. Every page benefits from a self-referencing canonical pointing to its own preferred URL. Without one, search engines rely entirely on other signals to pick the canonical.
Canonical pointing to a non-200 page. A canonical URL returning a redirect, 404, or 410 invalidates the declaration. The canonical target must return 200.
Canonical on paginated content. Each page in a paginated series self-canonicalizes to itself. Pointing all pages to page one hides pages two and beyond from the index.
Canonical combined with noindex. A page with
noindex and rel="canonical" sends conflicting
signals. The noindex tells search engines to drop
the page. The canonical tells them to consolidate
onto the page. Pick one.
Relative URLs. Google recommends absolute canonical URLs. Relative references are valid Link header syntax, but a relative path invites parsing ambiguity and risks the canonical resolving to the wrong URL.
Canonicalizing to unrelated content. The target URL must contain content identical or nearly identical to the source. Pointing a product page canonical to the homepage is a signal search engines are likely to ignore, selecting their own canonical instead.
Example
A product page accessible with and without query parameters. The canonical Link header consolidates signals onto the clean URL.
HTTP/1.1 200 OK
Content-Type: text/html
Link: <https://example.re/products/widget>; rel="canonical"
Both https://example.re/products/widget?ref=email
and https://example.re/products/widget?sort=price
return this same canonical header, pointing search
engines to the parameter-free URL.
A 103 Early Hints response carrying the canonical early, with the final response repeating the header for crawlers.
HTTP/1.1 103 Early Hints
Link: <https://example.re/products/widget>; rel="canonical"
HTTP/1.1 200 OK
Content-Type: text/html
Link: <https://example.re/products/widget>; rel="canonical"
A PDF hosted at multiple URLs with a canonical Link header declaring the preferred version.
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: inline
Link: <https://example.re/docs/guide.pdf>; rel="canonical"
A response combining canonical with resource hints in a single Link header.
HTTP/1.1 200 OK
Content-Type: text/html
Link: <https://example.re/page>; rel="canonical", </css/main.css>; rel="preload"; as="style", <https://cdn.example.re>; rel="preconnect"
See also
- RFC 6596: The Canonical Link Relation
- Google: Consolidate duplicate URLs with canonicals
- Google: How to specify a canonical
- Bing: Content quality and canonicalization
- RFC 8288: Web Linking
- Link
- Hreflang
- Redirects
- Soft 404
- Resource Hints
- HTTP headers