---
title: "Canonical mismatch between HTML and HTTP header"
description: "When a page's canonical tag and its Link header name different URLs, search engines get two answers. Here is why and how to fix it."
url: https://ursy.com/wiki/canonical-mismatch-between-html-and-http-header/
updated: 2026-11-25T01:34:15+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/canonical-mismatch-between-html-and-http-header/
---

# Canonical mismatch between HTML and HTTP header

> When a page's canonical tag and its Link header name different URLs, search engines get two answers. Here is why and how to fix it.

**A canonical mismatch between [HTML](https://ursy.com/wiki/html/) and [HTTP](https://ursy.com/wiki/http/) header is when a page names one preferred address in its `<link rel="canonical">` tag and a different one in a `Link: ...; rel="canonical"` response header.** [Search engines](https://ursy.com/wiki/search-engine/) then get two answers to one question. [Google](https://ursy.com/wiki/google/) asks you not to do this, and the usual result is that your choice of canonical carries less weight.

## What is a canonical mismatch? {#what-is-a-canonical-mismatch}

A [canonical tag](https://ursy.com/wiki/canonical-tag/) tells search engines which version of a page you want shown when several addresses carry the same or very similar content. Google’s guide to [consolidating duplicate URLs](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls) lists more than one way to say this. Two of them live in different layers:

- **In the HTML:**  a `<link rel="canonical" href="...">` element in the head of the page.
- **In the HTTP response:**  a header sent by the server before the HTML, in this form:

```
Link: <https://www.example.com/shoes/>; rel="canonical"
```

The header format comes from the web linking standard, [RFC 8288](https://www.rfc-editor.org/rfc/rfc8288), which defines how links travel in HTTP headers. A mismatch exists when both are present and they point to different URLs. If only one is present, or both name the same address, there is no problem.

## How does it happen? {#how-does-it-happen}

Almost never on purpose. The two layers are usually set by different parts of a site, and nobody looks at both at once.

- **A plugin and a server rule both act.**  An [SEO](https://ursy.com/wiki/seo-search-engine-optimisation/) plugin writes the tag; a server or [CDN](https://ursy.com/wiki/cdn/) rule adds a header written years ago for an old address.
- **A migration.**  After a move to HTTPS or from [www to non-www](https://ursy.com/wiki/www-vs-non-www/), the template is updated but the header rule still names the old host.
- **Trailing slash or parameter drift.**  One layer says `/shoes`, the other says `/shoes/`, or one keeps a [URL parameter](https://ursy.com/wiki/url-parameter/) the other drops. See [trailing slash](https://ursy.com/wiki/trailing-slash/).
- **Relative versus absolute.**  A [relative URL](https://ursy.com/wiki/relative-url/) in one place resolves to something other than the [absolute URL](https://ursy.com/wiki/absolute-url/) in the other.
- **A cached header.**  An [edge cache](https://ursy.com/wiki/edge-cache/) keeps serving an old header after the page itself changed.

## Why does it matter for search? {#why-does-it-matter-for-search}

Google calls its canonical methods signals, not orders. It describes the `rel="canonical"` annotation as a strong signal. When the signals agree, they add up. When they disagree, Google has to work out the preferred page from everything else: internal links, the [XML sitemap](https://ursy.com/wiki/xml-sitemap/), redirects and the content itself.

The same Google guide is direct about this case. It says not to name different URLs as canonical for the same page using different methods, and it recommends choosing one method and sticking with it. A page that breaks that rule hands the decision back to Google. The address that ends up in results may be neither of the two you named. That can split [link equity](https://ursy.com/wiki/link-equity/), show the wrong address in results, and leave reports full of pages flagged as [duplicates](https://ursy.com/wiki/duplicate-content/).

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

[AI search](https://ursy.com/wiki/ai-search/) tools that build on a search index inherit its choice of canonical. If Google or [Bing](https://ursy.com/wiki/bing/) settles on the wrong version, that is the address an AI answer is likely to cite. Clear, consistent signals make it more likely that the page you maintain is the one that gets quoted. It also keeps [citation tracking](https://ursy.com/wiki/citation-tracking/) clean, because one page is counted once, not under two addresses. Our [AI consistency checker](https://ursy.com/ai-consistency-checker/) helps spot cases where tools show different versions of the same facts.

## When is the header the right method? {#when-is-the-header-the-right-method}

The header exists for files that have no [HTML head](https://ursy.com/wiki/html-head/). Google notes that the tag only works on HTML pages, while the header also works for non-HTML documents such as PDF files. A common use is a PDF white paper that duplicates an HTML article. The PDF response carries the header pointing to the article. Google says it supports the header method in web search results only. For ordinary HTML pages, the tag is usually easier to see and maintain, so most sites should use the tag and send no canonical header on HTML at all.

## Common mistakes {#common-mistakes}

- **Fixing only the tag.**  You update the template, but the header still disagrees. Always check both.
- **Adding a header “to be safe”.**  Two methods that agree today can drift apart after the next change.
- **Testing in a browser only.**  View source shows the tag but not the response headers.
- **Pointing to a redirect.**  A canonical that names a [URL](https://ursy.com/wiki/url/) which then redirects sends a further mixed signal. See [redirect](https://ursy.com/wiki/redirect/).
- **Pointing to a page that is blocked or set to [noindex](https://ursy.com/wiki/noindex/).**  The preferred page has to be one Google can index.
- **Mixing up canonical and hreflang.**  Both can use the `Link` header. Only the one with `rel="canonical"` counts here. See [hreflang](https://ursy.com/wiki/hreflang/).

## A worked example {#a-worked-example}

An online shop sells a “Blue Kettle” at `https://www.example.com/kettles/blue-kettle/`. A product filter also shows it at `/kettles/?colour=blue`. The page source carries:

```
<link rel="canonical" href="https://www.example.com/kettles/blue-kettle/">
```

But a header check shows the server also sends:

```
Link: <http://example.com/blue-kettle>; rel="canonical"
```

That header came from a rule written before the shop moved to HTTPS and to a new folder structure. It names the old host, the old scheme and an address without a trailing slash. Two strong signals now point at two places, one of which redirects.

The fix is to delete the header rule for HTML pages, keep the tag, purge the cache, and re-test. In [URL Inspection](https://ursy.com/wiki/url-inspection/), the shop owner then compares the user-declared canonical with the one Google selected. Google’s [URL Inspection help](https://support.google.com/webmasters/answer/9012289) notes the two can differ, that the live test cannot predict the final canonical, and that the indexed value can lag by a few hours. So a clean result may take one recrawl to show.

## How to check it {#how-to-check-it}

1. Run the page through our [canonical checker](https://ursy.com/canonical-checker/) to see the tag.
2. Run it through our [HTTP header checker](https://ursy.com/http-header-checker/) and look for a `Link` header with `rel="canonical"`. The [header checker guide](https://ursy.com/guides/how-to-use-http-header-checker/) shows where it appears.
3. Compare the two addresses letter by letter: scheme, host, path, slash and parameters.
4. Check that the chosen address returns 200, not a redirect, with our [redirect checker](https://ursy.com/redirect-checker/), and that it is indexable with the [indexability checker](https://ursy.com/indexability-checker/).
5. For a whole site, run our [SEO audit](https://ursy.com/seo-audit/), or use the [duplicate content checker](https://ursy.com/duplicate-content-checker/) on pages Google flags.
6. In [Google Search Console](https://ursy.com/wiki/google-search-console/), look at pages listed as [duplicate without user-selected canonical](https://ursy.com/wiki/duplicate-without-canonical/) or [alternate page with proper canonical tag](https://ursy.com/wiki/alternate-page-with-proper-canonical-tag/).

## Questions {#questions}

### Which one wins, the tag or the header? {#which-one-wins-the-tag-or-the-header}

Google does not publish a winner. RFC 8288 does not rank header links above links in the content either. Treat any mismatch as a fault to fix, not a contest.

### Is it a penalty? {#is-it-a-penalty}

No. It is a weak, confusing signal. Google picks a canonical itself, which may not be the one you want.

### Can I use both if they match? {#can-i-use-both-if-they-match}

It works, but Google recommends choosing one method. Fewer places means fewer chances to drift.

## Related words {#related-words}

- [Canonical tag](https://ursy.com/wiki/canonical-tag/)
- [HTTP headers](https://ursy.com/wiki/http-headers/)
- [Duplicate content](https://ursy.com/wiki/duplicate-content/)
- [X-Robots-Tag](https://ursy.com/wiki/x-robots-tag/)
- [Technical SEO for AI search](https://ursy.com/wiki/technical-seo-for-ai-search/)

## Sources {#sources}

- [Google Search Central: How to specify a canonical URL](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls), checked 25 November 2026
- [Google Search Console Help: URL Inspection tool](https://support.google.com/webmasters/answer/9012289), checked 25 November 2026
- [IETF RFC 8288: Web Linking](https://www.rfc-editor.org/rfc/rfc8288), checked 25 November 2026

*Updated 25 November 2026 by URSY.*
