fix(docs): add redirects and llms.txt improvements to prevent AI agent 404s#2697
fix(docs): add redirects and llms.txt improvements to prevent AI agent 404s#2697michaelmagan merged 2 commits intomainfrom
Conversation
…t 404s AI agents using llms.txt were hitting 404s by guessing short URLs (/quickstart), wrong slugs (/concepts/component-state), and folder URLs without index pages (/guides/setup-project). Adds 27 permanent redirects in next.config.mjs, a URL guide line in llms.txt, and (section) suffixes on section headers so agents stop treating them as paths. Also documents the folder index page requirement in AGENTS.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Reviewed PR #2697. All 27 redirect destinations verified against actual MDX pages — no broken targets, no source conflicts, no duplicates. Left two non-blocking comments: (1) Group C folder-index redirects should consider Task list (7/7 completed)
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
TL;DR — Adds 27 permanent redirects and improves Key changes
Summary | 3 files | 1 commit | base: Redirect rules for common AI agent URL guesses
The redirects are organized into three commented groups in the
|
There was a problem hiding this comment.
All redirect destinations verified — every target path maps to an existing MDX page, no source conflicts with existing content, and no duplicate sources. Two items worth considering below.
Claude Opus | 𝕏
Per PR feedback, Group C folder-index redirects should use permanent: false (307) since these are stopgaps until proper index.mdx files are added. Prevents browsers from caching a 301 that would mask a future index page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No action needed. The author's comment "Good catch: now 307." was acknowledging the review feedback about using
|
…t 404s (#2697) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

Summary
next.config.mjsto catch common AI agent URL guesses: top-level shortcuts (/quickstart,/mcp), wrong slugs (/concepts/component-state), and folder URLs without index pages (/guides/setup-project)llms.txtwith a URL guide line telling agents to use links verbatim, and appends(section)to section headers so they aren't mistaken for URL pathsdocs/AGENTS.mdTest plan
npm run buildpasses in docs/curl -I localhost:8263/quickstartreturns 308localhost:8263/llms.txtshows(section)suffixes and URL guide line/getting-started,/concepts,/guides/setup-project🤖 Generated with Claude Code