A canonical mismatch between HTML and 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 then get two answers to one question. 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? #
A 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 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, 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? #
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 plugin writes the tag; a server or 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, 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 the other drops. See trailing slash. - Relative versus absolute. A relative URL in one place resolves to something other than the absolute URL in the other.
- A cached header. An edge cache keeps serving an old header after the page itself changed.
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, 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, show the wrong address in results, and leave reports full of pages flagged as duplicates.
Why does it matter for AI answers? #
AI search tools that build on a search index inherit its choice of canonical. If Google or 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 clean, because one page is counted once, not under two addresses. Our AI consistency checker helps spot cases where tools show different versions of the same facts.
When is the header the right method? #
The header exists for files that have no 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 #
- 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 which then redirects sends a further mixed signal. See redirect.
- Pointing to a page that is blocked or set to noindex. The preferred page has to be one Google can index.
- Mixing up canonical and hreflang. Both can use the
Linkheader. Only the one withrel="canonical"counts here. See hreflang.
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, the shop owner then compares the user-declared canonical with the one Google selected. Google’s URL Inspection help 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 #
- Run the page through our canonical checker to see the tag.
- Run it through our HTTP header checker and look for a
Linkheader withrel="canonical". The header checker guide shows where it appears. - Compare the two addresses letter by letter: scheme, host, path, slash and parameters.
- Check that the chosen address returns 200, not a redirect, with our redirect checker, and that it is indexable with the indexability checker.
- For a whole site, run our SEO audit, or use the duplicate content checker on pages Google flags.
- In Google Search Console, look at pages listed as duplicate without user-selected canonical or alternate page with proper canonical tag.
Questions #
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? #
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? #
It works, but Google recommends choosing one method. Fewer places means fewer chances to drift.
Related words #
Sources #
- Google Search Central: How to specify a canonical URL, checked 25 November 2026
- Google Search Console Help: URL Inspection tool, checked 25 November 2026
- IETF RFC 8288: Web Linking, checked 25 November 2026
Updated 25 November 2026 by URSY.
Cite this page: Canonical mismatch between HTML and HTTP header. URSY. Updated 25 November 2026. https://ursy.com/wiki/canonical-mismatch-between-html-and-http-header/ · Section links
Tools for this
- LiveHTTP Header Checker (cache, status, X-Robots-Tag)Run the check →
- LiveVerify an AI Botis it really GPTBot? IP, published lists and user agentRun the check →
- Livellms.txt Checker + Generatorcheck your llms.txt, or write llms.txt, llms-full.txt and llms.jsonRun the check →
- LiveAI Training Opt-Out Checker + Generatorwhat each AI may do with your site, and the exact lines to change itRun the check →
- LiveAI Consistency Checkerpage, schema, llms.txt and feeds state the same facts?Run the check →
- LiveGoogle Snippet Previewtitle and description length in pixels (in browser)Run the check →
- ProAI consistency monitorFacts that differ between page, schema, feeds and llms.txtIn URSY Pro →
- ProAI competitor gapPrompts where rivals appear and you don'tIn URSY Pro →
- ProAI fact accuracy monitorAI quoting your prices and facts wrong, with alertsIn URSY Pro →