What are HTTP headers?

HTTP headers are the initial requests and responses that are transmitted between a browser and a web server.
HTTP headers include information such as the client’s browser, requested page, server type, and more, but can also include instructions for the browser to redirect to another page or to a search engine not to index the requested page.

Example of HTTP request

When you type a URL in your address bar, your browser sends an HTTP request, and it may look like this:

GET / HTTP/2
Host: seosmoothie.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Pragma: no-cache
Cache-Control: no-cache

After that request, your browser receives an HTTP response that may look like this:

HTTP/2 200 OK
date: Thu, 13 Jan 2022 10:46:16 GMT
content-type: text/html; charset=UTF-8
x-powered-by: PHP/8.0.13
accept-ch: Sec-CH-UA-Mobile
cache-control: no-cache
x-nitro-cache: HIT
x-nitro-cache-from: drop-in
vary: user-agent,Accept-Encoding
x-nitro-rev: 5b7a22c
link: <https://seosmoothie.com/wp-json/>; rel="https://api.w.org/", <https://seosmoothie.com/wp-json/wp/v2/pages/15>; rel="alternate"; type="application/json", <https://seosmoothie.com/>; rel=shortlink
x-cache-ctime: 1642059482
cf-cache-status: DYNAMIC
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=GH0kSoaurvp6H7AvjSb3sDw3SDOK54Gq%2BbVLlvWJqwa%2B7hbD%2F3uR0oZmP1A2DLErUqjbyVeBJLCbq6Ywx7I3nP0h%2FwN6kk9zBULCulOq0YcPQxIhzcJwlOo6kCS7zSO61jXGz%2FPTJ6COcbuPmG4%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 6cce0a2f7aa9ede3-CDG
content-encoding: br
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; ma=86400
X-Firefox-Spdy: h2

The first line is the “Status Line”, followed by “HTTP Headers”. When you look at the source code of a web page in your browser, you will only see the HTML portion and not the HTTP headers, even though they actually have been transmitted together.

Response header mozilla

SEO‑relevant signals

HTTP headers can return many SEO‑relevant signals — including a canonical URL. When the canonical in the HTTP header differs from the canonical in the HTML <head>, Google chooses the one it trusts more based on consistency, crawlability, and site patterns. LLMs generally ignore header canonicals and rely on the visible HTML or extracted URL patterns.

What HTTP Headers Can Return (SEO‑Relevant)

HTTP headers can include many SEO‑impacting directives, for example:

HeaderPurpose
Link: <…>; rel=”canonical”Declares canonical URL at the header level
Link: <…>; rel=”alternate”Hreflang or AMP relationships
X-Robots-TagIndexing rules (noindex, nofollow, nosnippet…)
Content-TypeDeclares document type (HTML, JSON, PDF…)
VaryAffects caching and can impact duplicate detection
LocationRedirect target
Cache-ControlCaching behavior

So yes — a canonical can be returned in the HTTP header, not only in the HTML.

What Happens When Canonical in Header ≠ Canonical in HTML?

Google’s Behavior

Google has stated:

Google chooses the canonical it trusts most.

If the header canonical conflicts with the HTML canonical, Google evaluates:

  • Consistency across internal links
  • Sitemaps
  • Redirects
  • URL parameters
  • Content similarity
  • Historical signals
  • PageRank flow

Priority is NOT fixed.

Google does not always prefer header or HTML.
But in practice:

Google often trusts the HTML canonical more

…because it is more commonly used and less likely to be misconfigured.

BUT Google may override both

If neither canonical matches what Google believes is the “main” URL, it will pick its own.

If header and HTML canonicals disagree, Google sees it as a strong inconsistency signal.

This can lead to:

  • Canonical being ignored
  • Wrong URL chosen
  • Duplicate content clustering issues
  • Indexing delays
  • Lower crawl efficiency

How LLMs (ChatGPT, Gemini, etc.) Treat This

LLMs do not crawl the web like Google and do not process HTTP headers during training.

LLM behavior:

  • They mostly rely on HTML content, not headers.
  • They do not evaluate canonical correctness.
  • They do not cluster duplicates like search engines.
  • They may treat each URL as separate content if both versions appear in training data.

So if header canonical ≠ HTML canonical:

  • Google cares a lot
  • LLMs do not care at all

SEO Impact When Canonicals Conflict

Negative effects you may see:

  • Wrong page indexed
  • Duplicate pages competing
  • Wrong URL shown in SERPs
  • Loss of link equity consolidation
  • Lower crawl budget efficiency
  • Canonicalization flip‑flopping in Search Console

Google Search Console symptoms:

  • “Duplicate, Google chose different canonical than user”
  • “Alternate page with canonical tag”
  • “Duplicate without user-selected canonical”

Best Practices to Avoid Problems

Always keep canonical consistent across:

  • HTML <head>
  • HTTP header
  • XML sitemap
  • Internal links
  • Redirects

If you use header canonicals (e.g., for PDFs, images, or non-HTML files):

  • Make sure they match the HTML canonical of the target page.

Avoid using both unless necessary

For HTML pages, prefer the HTML canonical and skip the header version.

You might also be interested in:

What is Noindex?

What is Redirect?

What is 301 Redirect?

What is 200 OK Status?

What is 302 Redirect?

What is 404 Error?

What is Soft 404 Error?