Free auditStart free
GlossaryGlossary · Crawling and indexing

Canonical HTTP header

The canonical HTTP header sends rel=canonical in a Link response header, so non-HTML files like PDFs can name a preferred URL. Syntax, limits, and a live check.

2 min
read
1
sources
Oct 31, 2026
updated
Scaplet Editorial Team
author
In one line

A canonical HTTP header is a Link response header with rel="canonical" that names the preferred URL for a resource. Google says to use it where an HTML link element can't go, mainly non-HTML files such as PDFs. Use absolute URLs, and pick either the header or the HTML element, not both.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
Link: <URL>; rel="canonical"
Header
PDFs and other non-HTML files
Best for
Absolute, not relative
URL form
Web search results only
Google support
01At a glance

Anatomy of the header

A PDF has no <head>, so it can't hold a <link rel="canonical"> element. The HTTP header does the same job from the response. Google's guidance gives an example where the same content exists as a PDF and a Word file: the Word file's response points to the PDF as the canonical version.
Part

Link:

Meaning
The HTTP response header that carries link relations
Part

<https://...pdf>

Meaning
The preferred URL, in angle brackets, absolute
Part

rel="canonical"

Meaning
Declares that URL as the canonical version of this response's resource
Part

Sent from the duplicate

Meaning
The file you don't prefer carries the header, pointing at the one you do
Response for the non-preferred file
HTTP/1.1 200 OK
Content-Type: application/msword
Link: <https://www.example.com/downloads/white-paper.pdf>; rel="canonical"
03Your call

Check it in 2 minutes

At the time of writing this prints content-type: application/pdf and a link: header with rel="canonical", so the RFC Editor's PDF names its info page as the preferred URL. Run the same command on your own files. No link line means the file sends no canonical header.
If this fits

Use the header if

  • The duplicate is a PDF or other file with no HTML head
  • You control server or CDN configuration
  • A small, stable set of files needs mapping
Or

Use the HTML element if

  • The duplicates are HTML pages
  • You can edit templates but not server headers
  • You want the signal visible in the page source
Read the header on a real PDF
curl -sI https://www.rfc-editor.org/rfc/rfc9110.pdf | grep -i -E '^(content-type|link)'
Questions

Asked a lot.

1 questions people ask next, answered from the sources on this page.

01Does the canonical HTTP header work for images or video?

Google's documentation describes the header for cases where an HTML link element can't be used, mainly non-HTML files such as PDFs, and says it is supported only for web search results. It doesn't describe other uses.

Sources · 1

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • google.com
  1. 01How to specify a canonical URL (Google Search Central)developers.google.com · checked 2026-11-01
Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly