Set a canonical URL for a PDF or other non-HTML file using the HTTP Link header

domain: developers.google.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Identify non-HTML resources (PDF, Word doc, etc.) that duplicate content available at an HTML URL
  2. Configure your server/CDN to return a Link response header formatted as Link: <https://example.com/page>; rel="canonical" on requests for the non-HTML resource
  3. Use an absolute URL in the header value, matching the same rule as the HTML rel=canonical link element
  4. Verify the header renders correctly using a raw HTTP request (e.g. curl -I) rather than a browser, since it isn't visible in rendered HTML
  5. Avoid also adding a conflicting rel=canonical link element for the same resource that points elsewhere

Known gotchas

Related routes

Set canonical via HTTP Link header for PDFs and other non-HTML files
canonicalization · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans