Picture an exporter who has published its product catalog as three separate PDF files: Turkish, English and German. When a buyer in Germany searches for a catalog, how does Google know which file to show? On web pages, hreflang annotations usually sit in the head section as link elements. A PDF has no head section, so the route Google documents for non-HTML files is the HTTP response header, specifically a Link header. The catalog scenario below is a hypothetical example, but the method is real and works for any downloadable file. If hreflang is new to you, start with our what is hreflang guide.
Key Takeaways
- For non-HTML files such as PDFs, hreflang is delivered in the HTTP Link response header.
- Every language version must list all sibling versions and itself. A one-way list is not enough.
- Use absolute URLs and valid ISO language codes in every entry.
- Configure headers at the server or CDN layer, then verify them with
curlrather than a browser. - Choose between header, HTML and sitemap methods case by case; this article could not confirm sitemap support for PDFs.
Why PDFs need a different approach
Hreflang is a signal that tells search engines which language or regional version of the same content exists. On web pages it is usually expressed with link elements in the head section. A PDF has no such head section, so the signal has to travel outside the file, in the HTTP headers the server sends when it delivers the file. This matters for catalogs, technical data sheets, certificates and price lists, which are often distributed as downloads.
There is an important distinction here. Language information inside the file does not do the same job as hreflang. Hreflang establishes the relationship between versions. Assuming that the language written inside a document replaces hreflang is one of the most common misunderstandings. The second frequent mistake is adding a header to a single language file and considering the job done. Hreflang requires reciprocity: every file has to point back to the others.
What a Link header is and how hreflang travels in it
The HTTP Link header is a standard response header used to describe resources related to the current one. Google supports adding rel="alternate" and hreflang parameters to it. The basic form looks like this:
Link: <https://www.example.com/downloads/katalog-en.pdf>; rel="alternate"; hreflang="en"
The URL in angle brackets is the full address of the target version. Parameters are separated by semicolons, and the language value is wrapped in quotes. To list several versions, entries are joined with commas. The HTTP standard also allows the same header to be sent more than once, and both forms produce the same result. What matters is that each language version includes all sibling versions in its own response.
Syntax rules
The language value starts with an ISO 639-1 language code. Optionally, an ISO 3166-1 Alpha-2 country code can follow, for example en-gb or de-de. Do not confuse the two: for the United Kingdom the correct value is en-gb, not en-uk. If there is no regional difference, a language code alone is enough, and for most catalogs that is the cleaner choice.
The x-default value
When no version matches the user's language, the default version is marked with x-default. The same logic applies to PDFs. For example, you can designate the English file as the general fallback. For the details, see our x-default guide.
Sample header lines
For our hypothetical exporter, which publishes its catalog in three languages, the response header of the English file could look like this:
Link: <https://www.example.com/downloads/katalog-en.pdf>; rel="alternate"; hreflang="en",
<https://www.example.com/downloads/katalog-de.pdf>; rel="alternate"; hreflang="de",
<https://www.example.com/downloads/katalog-tr.pdf>; rel="alternate"; hreflang="tr",
<https://www.example.com/downloads/katalog-en.pdf>; rel="alternate"; hreflang="x-default"
The same list is repeated word for word in the German and Turkish files. The list must be complete and identical in every file. Only the file's own address stays the same, and it is already part of the list. Forgetting to include the file's own URL is a common error; in Google's examples, every version lists itself as well.
In this example example.com is a placeholder domain. In a real deployment, all addresses should live on your canonical domain and use HTTPS.
Server setup
Headers are defined at the layer that serves the file, either the origin server or the CDN. The examples below do not perform redirects; they only add headers. Syntax can differ slightly between server versions, so test in a staging environment first.
Apache
Apache requires the mod_headers module to be enabled. The block below adds headers to PDF files whose names start with katalog:
<FilesMatch "katalog-.*\.pdf$">
Header add Link "<https://www.example.com/downloads/katalog-en.pdf>; rel=\"alternate\"; hreflang=\"en\""
Header add Link "<https://www.example.com/downloads/katalog-de.pdf>; rel=\"alternate\"; hreflang=\"de\""
</FilesMatch>
Nginx
In Nginx, the add_header directive works in the location block where it is defined. Headers defined in a parent block are not inherited once a child block declares its own add_header. For that reason, write all Link lines for the PDF location together:
location ~* katalog-.*\.pdf$ {
add_header Link "<https://www.example.com/downloads/katalog-en.pdf>; rel=\"alternate\"; hreflang=\"en\"";
add_header Link "<https://www.example.com/downloads/katalog-de.pdf>; rel=\"alternate\"; hreflang=\"de\"";
}
CDN and cache notes
If files are served through a CDN, test whether the edge keeps the headers intact. Some setups rewrite or strip response headers at the edge. After changing headers, purge the cache and confirm that old responses are no longer returned. WordPress teams may face a separate issue with PDFs in the media library; our WordPress hreflang setup guide covers the approach to take there.
Validation steps
After publishing the headers, check them from the command line rather than a browser, because browsers do not display every response header. On Windows, curl.exe works in PowerShell or Git Bash. The checklist is:
- Fetch the headers: run
curl.exe -I https://www.example.com/downloads/katalog-en.pdfand read the response headers. - Check the status code: the response should be 200. If the file redirects or lands on a login page, search engines cannot reach it.
- Verify absolute URLs: every Link entry needs the scheme and full domain.
- Check reciprocity: each language file must include all sibling versions and itself. A missing return link can cause the signal to be ignored.
- Review language codes: case does not matter, but an invalid code such as
en-ukis not valid. - Avoid canonical conflicts: each language file should declare its own URL as canonical.
All of these checks can be done at the header level. To observe real search behaviour, you can also use the URL Inspection tool in Search Console. We could not confirm whether Search Console offers a dedicated report for PDF hreflang at the time of writing, so rely on header testing rather than waiting for a report. Google's documentation can change over time; review the current page before implementing.
Common mistakes
The table below summarises the most frequent problems in PDF hreflang implementations and the first corrective steps.
| Mistake | Symptom | Fix |
|---|---|---|
| Missing return links | Each file lists the others, but some do not list themselves | Add the complete list, including the file's own URL, to every file. See our return tag errors guide for details. |
| Relative URLs | A Link entry starts with a slash | Write absolute URLs with scheme and domain. |
| Wrong language code | Country codes such as en-uk are used incorrectly | Use an ISO 639-1 language code and, where needed, an ISO 3166-1 country code. |
| Redirect chains | A listed file returns 301 to another address | Make sure every listed URL returns 200 directly. |
| Header on only one file | A signal exists for one language but not the others | Apply the configuration to all language files and test each one. |
| Edge cache strips the header | The header is present at origin but missing on the public address | Review the CDN rule and purge the cache. |
Sitemaps and HTML alternatives
For HTML pages, hreflang can be set with head elements, sitemaps or HTTP headers. For PDFs, most teams prefer headers, because they define the relationship without touching the file's content. We could not confirm in this article whether Google supports hreflang for PDFs through sitemaps, so check the current Google documentation before relying on that method. You can compare the three approaches in our implementation methods guide.
A practical rule of thumb: if the file sits next to an HTML landing page, use HTML hreflang on that page and also add headers to the PDFs. If the file is distributed on its own, headers are the only option. Which method fits best depends on your team's technical setup and should be decided together with the people who maintain the server.
Conclusion and next step
For PDFs, hreflang is delivered through the HTTP Link header, and for it to work every language version must list all sibling versions and itself. Start by writing sample headers for one catalog, test them with curl.exe -I, and then roll the approach out to the other files. Before writing any header, list which languages each catalog exists in and the exact address of each file; deciding which file belongs to which language is the most valuable first step. If you would like help building that list with your team, you are welcome to get in touch.




No comments yet
Leave a Comment