# 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.

Canonical: https://scaplet.com/glossary/canonical-http-header

Glossary Glossary · Crawling and indexing

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fcanonical-http-header%20(%22Canonical%20HTTP%20header%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fcanonical-http-header%20(%22Canonical%20HTTP%20header%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fcanonical-http-header%20(%22Canonical%20HTTP%20header%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fcanonical-http-header%20(%22Canonical%20HTTP%20header%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## 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

_01_At 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"
```

_02_At a glance

## Header or HTML element?

Method

### HTML `link` element

Works for

HTML pages

Needs

Edit the page `<head>`

Watch for

Choose it or the header, not both

Method

### HTTP `Link` header

Works for

Any response, including PDFs

Needs

Access to server configuration

Watch for

Hard to maintain on large sites or when URLs change often

Google's consolidation guide says to choose either the HTML element or the HTTP header rather than both, because using both is more error-prone. It also says the header doesn't increase page size and can map an unlimited number of duplicates. For the full picture of how Google picks a canonical, see [canonical URL](/glossary/canonical-url).

**Relative URLs and fragments**Use an absolute URL in the header. Google's guide also says not to specify a URL fragment as the canonical, because Google generally doesn't support fragments. See [URL fragment](/glossary/url-fragment).

_03_Your 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.

_01_ Does 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](/glossary/serp). 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. 01 [How to specify a canonical URL (Google Search Central)](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls) developers.google.com · checked 2026-11-01

## Keep learning

[All glossary](/glossary)

[Learn URL fragment Crawling and indexing](/glossary/url-fragment) [Related HTTP caching Performance](/glossary/http-caching) [Read next Canonical URL Crawling and indexing](/glossary/canonical-url) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Cache-Control](/glossary/cache-control) [Case study](/glossary/case-study)

More in Crawling and indexing
[www vs non-www](/glossary/www-vs-non-www) [X-Frame-Options](/glossary/x-frame-options) [X-Robots-Tag](/glossary/x-robots-tag) [XML sitemap](/glossary/xml-sitemap) [301 redirect](/glossary/301-redirect) [302 redirect](/glossary/302-redirect) [410 Gone](/glossary/410-gone) [A record (DNS address record)](/glossary/a-record) [Bing Webmaster Tools](/glossary/bing-webmaster-tools) [Bot management](/glossary/bot-management) [Broken links](/glossary/broken-links) [cache: search operator](/glossary/cache-search-operator) [Canonical HTTP header](/glossary/canonical-http-header) [Canonical URL](/glossary/canonical-url) [Client-side rendering](/glossary/client-side-rendering) [Crawl budget](/glossary/crawl-budget) [Crawl errors](/glossary/crawl-errors) [Crawl stats report](/glossary/crawl-stats-report) [Duplicate content](/glossary/duplicate-content) [Dynamic serving](/glossary/dynamic-serving) [ETag](/glossary/etag) [Google Indexing API](/glossary/google-indexing-api) [Google Search Console](/glossary/google-search-console) [HTML sitemap](/glossary/html-sitemap)

Terms on this page
[Canonical URL](/glossary/canonical-url) [URL fragment](/glossary/url-fragment) [SERP](/glossary/serp)

Free · 2 minutes

## Know the term. _Now check your site._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
