In beta, with limited placesOpen to everyone in Q1 2027

↑↓ to move · Enter to open · Esc to close

Crawling and indexing

What is the HTTP Link header with rel=alternate?

The Link rel=alternate header is a line of the HTTP response that announces that the same content exists in another version, at another address: in another language, if it carries hreflang, or in another format, if it carries type, such as a PDF or a Markdown version. It says the same as the HTML link element, but it also works for files that are not HTML.

Written by
Reviewed by
Published 8 min read
Takeaway:

Key takeaways

  • Link is a standard HTTP header (RFC 8288) that declares relationships between URLs; rel=alternate is the one that says "this same thing, in another version".
  • With hreflang it announces a translation; with type, the same content in another format.
  • Google accepts hreflang in the Link header and treats it the same as in the HTML or the sitemap: it is the route for PDFs and other non-HTML files.
  • The llms.txt proposal recommends announcing the Markdown version of each page this way, although Google says it does not need Markdown for its Search.
  • alternate does not say which version is in charge: that is the job of the canonical relation.

The Link header is not a link you can see on the page or the <link> element in the <head>, although it says the same thing: it is a line among the response headers, invisible in the browser unless you open its developer tools. It helps a store in three cases. When it has files that are not HTML, such as the technical spec sheet as a PDF, and cannot give them a <head>. When it publishes versions in several languages. And when it wants to offer AI agents a Markdown version of each page without touching the theme templates. It is the way to declare relationships between URLs from the server or the CDN, not from the HTML.

How it works

The Link header is defined by RFC 8288, Web Linking, which M. Nottingham published in October 2017 and which replaced RFC 5988. The standard describes a link with four pieces: the context (the URL that responds), the relation type, the target and, if needed, some target attributes. In the header you write the target URL between angle brackets, then rel with the relation type and, separated by semicolons, the attributes. Several links fit in a single header, separated by commas, or in several Link headers in a row.⁠[1]IETF (M. Nottingham). RFC 8288: Web Linking

The attributes the standard defines for the target are hreflang, a hint about language; type, a hint about file type; media; title; and anchor, which changes the link's context. On that last one, the RFC warns that a header with anchor is a third-party assertion and cannot be trusted without checking it.⁠[1]IETF (M. Nottingham). RFC 8288: Web Linking

alternate is one of the relation types registered with IANA, with a one-line description: it refers to a substitute for this context. For the detail, the registry points to the HTML standard.⁠[2]IANA. Link Relations And there the meaning depends on what accompanies the relation:⁠[3]WHATWG. HTML Standard: Link type "alternate"

  • With hreflang in a language different from the page's, the target is a translation.
  • With type, the target is a rewording of the same page in another format. With the RSS or Atom types, it is a syndication feed.
  • The two attributes can be combined, for a version in another language and another format at once.

What alternate does not say is which of the versions is in charge. For that there is another relation, canonical, which IANA describes as the one that designates the preferred version of a resource.⁠[2]IANA. Link Relations

Three uses on a store

Languages, with hreflang. Google supports three ways of telling it the localized versions of a page: elements in the HTML, the sitemap and HTTP headers, and says that to it the three are equivalent. The header is the one that works for files that are not HTML, such as PDFs. The rules are the same in all three methods: each version lists itself and all the others, the URLs are fully qualified, with their https://, and if two pages do not point at each other, Google ignores the indications. For anyone who fits no language there is the x-default value.⁠[4]Google Search Central. Tell Google about localized versions of your page

Formats, with type. The llms.txt proposal, in its version of August 10, 2026, asks that pages useful to agents have a clean Markdown version at the same URL with .md added, and recommends announcing it with standard relations: rel="alternate" type="text/markdown" toward the Markdown version and rel="describedby" toward the llms.txt that covers it. It proposes it in the HTML or in the header, and points out the advantage of the second: it is configured on the server or the CDN without modifying any page.⁠[5]llmstxt.org (Jeremy Howard). The /llms.txt file It is one of the ways of serving Markdown for agents. Google, for its part, says there is no need to create machine-readable files, AI text files, markup or Markdown to appear in its Search.⁠[6]Google Search Central. Optimizing your website for generative AI features on Google Search The Markdown version is an offer to agents that want to ask for it, not a Google requirement.

The canonical of what is not HTML. The same header carries other relations. Google accepts rel="canonical" in the response for files that are not HTML, for example to indicate that the PDF version of a document is the canonical one versus its .docx, and only for web search results. It recommends choosing one method and not mixing it with the HTML tag, because it is easy to end up declaring one URL in the header and another in the <link>.⁠[7]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods

On a store

A fictional example: a photography store publishes the technical spec sheet of a tripod as a PDF, in Spanish and in English. This is how the Spanish PDF responds:

HTTP/2 200
content-type: application/pdf
link: <https://tienda.example/docs/t20-ficha-es.pdf>; rel="alternate"; hreflang="es", <https://tienda.example/docs/t20-ficha-en.pdf>; rel="alternate"; hreflang="en"

The header lists itself and the English version, with fully qualified URLs, and the English PDF has to respond with the same two links. If one of the two does not return the pair, Google ignores both.⁠[4]Google Search Central. Tell Google about localized versions of your page

The product page of the same tripod, in HTML, announces its Markdown version and the site's llms.txt:

HTTP/2 200
content-type: text/html; charset=utf-8
link: </products/travel-tripod-t20.md>; rel="alternate"; type="text/markdown", </llms.txt>; rel="describedby"

It is the same shape as the example in the llms.txt proposal, with paths relative to the domain.⁠[5]llmstxt.org (Jeremy Howard). The /llms.txt file The fully qualified URL requirement is Google's for hreflang;⁠[4]Google Search Central. Tell Google about localized versions of your page for whoever reads this second header, the path is resolved against the URL that responded. Neither line shows on the page: the shopper notices nothing, and whoever reads the headers knows there is another version and where it is.

Warning:

What gets confused

alternate and canonical are not interchangeable. The first refers to a substitute; the second designates the preferred version.⁠[2]IANA. Link Relations Announcing the Markdown version with alternate does not make it the main one, and pointing the product page's canonical at it would say exactly that: that the version you want in the results is the .md. The product page's header carries alternate toward the Markdown and, if you declare the canonical in the header, the canonical toward the product page itself.

How to check it

  1. Request the URL with curl -I and look for the lines that start with link:. There can be several, or several links separated by commas in one.⁠[1]IETF (M. Nottingham). RFC 8288: Web Linking
  2. Look at the same response in the browser: in the developer tools, Network tab, pick the document and open its response headers.
  3. Open every URL the header announces. They have to respond with a 200, and in the case of hreflang, each version has to return the same group of links, with fully qualified URLs and itself included.⁠[4]Google Search Central. Tell Google about localized versions of your page
  4. Check that Google receives the header. In Search Console's URL Inspection, "Test live URL" and then "View tested page" show the HTTP headers of the response.⁠[8]Search Console Help. URL Inspection tool
  5. If you declare the canonical in the header, make sure it does not clash with the one in the HTML. Better a single method than two with different URLs.⁠[7]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods

Content negotiation solves the same thing from the other side. With alternate, each version has its own URL and the server announces it; with negotiation, there is a single URL and it is the client who asks for the format in the Accept header of its request. Cloudflare applies it in its Markdown for Agents feature: when an agent requests a page with Accept: text/markdown, it converts the HTML to Markdown at the edge, responds with Content-Type: text/markdown and adds Accept to the Vary header, so caches store the two versions separately.⁠[9]Cloudflare Docs. Markdown for Agents The two can be combined: a .md version with its own URL, announced with alternate, and the usual URL serving Markdown to whoever asks for it.

To keep going, the comparison of the files you offer to search engines and agents puts each in its place, and the reading path for this topic puts the rest of the terms in order.

Synonyms

English
Link header, HTTP Link header
Español
cabecera Link, encabezado Link

Sources

  1. [1] IETF (M. Nottingham). RFC 8288: Web Linking. Accessed . ↑ ↑ ↑
  2. [3] WHATWG. HTML Standard: Link type "alternate". Accessed . ↑
  3. [4] Google Search Central. Tell Google about localized versions of your page. Accessed . ↑ ↑ ↑ ↑
  4. [5] llmstxt.org (Jeremy Howard). The /llms.txt file. Accessed . ↑ ↑
  5. [6] Google Search Central. Optimizing your website for generative AI features on Google Search. Accessed . ↑
  6. [7] Google Search Central. How to specify a canonical URL with rel="canonical" and other methods. Accessed . ↑ ↑
  7. [8] Search Console Help. URL Inspection tool. Accessed . ↑
  8. [9] Cloudflare Docs. Markdown for Agents. Accessed . ↑

Change history

  • First English version.

This definition is published under CC BY 4.0. Reuse this definition freely, crediting Clione with a link to this page.

Make your catalog easy for bots to read

Clione fills every product page with what bots read best: the JSON-LD graph with its structured data, the meta description and the FAQs. You review and press Push; then we check your live store so it all stays published.