AI/LLM citation.
@Rahman @Amit Tiwari @all
Is it any valuable method?
NOTE: Boss induced query about getting cited by LLM chatbots.
Use content negotiation (same URL) + a .md twin. Do not rely on User-Agent redirects.
### Reliable methods
1. Content negotiation (best)
Same URL.
- Browser (Accept: text/html) → normal HTML landing page.
- Agent that sends `Accept: text/markdown` → clean Markdown.
Add `Vary: Accept` on both responses so caches do not mix them.
2. .md twin URLs
Serve Markdown at `/page.md` (or `/page/index.md`).
Advertise it from the HTML page with:
- HTML: `<link rel="alternate" type="text/markdown" href="/page.md">`
- HTTP header: `Link: </page.md>; rel="alternate"; type="text/markdown"`
Coding agents (Claude Code, Cursor, etc.) look for these.
3. Optional: `/llms.txt`
Short site index that points to the Markdown versions. Useful as a map for coding agents. Not needed for search citations.
### What not to do
- Do not put agent-only text on the visible landing page.
- Do not redirect by User-Agent alone. It is unreliable and fragile.
- Do not create a separate agent-only landing page that humans can reach by accident.
### Practical stack
- Keep the human landing page clean.
- Generate a Markdown version of the same content (strip nav, scripts, layout).
- Serve it via `Accept: text/markdown` on the same URL and at the `.md` path.
- Point to it with the `rel="alternate"` link + `Link` header.
- If you are on Cloudflare Pro+, you can enable their “Markdown for Agents” edge conversion instead of building it yourself.
This keeps the landing page clean for humans and gives agents a clean Markdown version when they ask for it.