Skip to content

Rule · AI search

No working Markdown alternate for this content page

geo/markdown-alternateinfovoid geoupdated

Why it matters

llms.txt v2 recommends per-page Markdown mirrors advertised with <link rel="alternate" type="text/markdown">; coding agents fetch them instead of parsing HTML. An advertised mirror that 404s or serves HTML is a warning.

How to fix it

Serve page.md via a route handler plus a proxy rewrite, and advertise it with alternates.types.

Example

ts
// app/blog/[slug]/page.tsx — generateMetadata
alternates: { canonical: path, types: { 'text/markdown': path + '.md' } },

// proxy.ts — /blog/hello-world.md → /md/blog/hello-world
export function proxy(request: NextRequest) {
  const { pathname } = request.nextUrl
  if (pathname.endsWith('.md')) return NextResponse.rewrite(new URL('/md' + pathname.slice(0, -3), request.url))
  return NextResponse.next()
}
export const config = { matcher: ['/blog/:path*', '/docs/:path*'] }

References

void geo reports 41 rules in this category. Generative-engine optimisation: whether AI crawlers that don't run JavaScript see the same content, valid and visible JSON-LD, an explicit AI robots policy, llms.txt, Markdown mirrors and answer-first writing.