Standards & Protocols · August 2026 · 6 min read

Why 65% of Webmasters Fall for the SPA Soft-404 Trap in llms.txt

Empirical audit of 100 web domains reveals how Next.js and SPA routing serve HTML soft-404s to AI crawlers querying /llms.txt, and the exact headers to fix it.

Server Infrastructure and Machine Readable Endpoints
Figure 1: Machine-readable endpoints bridge raw HTML and AI inference.

The Purpose of /llms.txt

The proposed /llms.txt standard provides AI models with a token-efficient plain text Markdown summary of a web property. Instead of forcing a search spider to scrape 50 KB of JavaScript and CSS (wasting 10,000+ LLM tokens), a clean manifest delivers verified brand facts and pricing tiers in under 500 tokens.

1. What is the SPA Soft-404 Trap?

In modern frameworks (Next.js App Router, Remix, Vite), unconfigured routes are intercepted by client-side routers. Instead of returning an HTTP 404, the server returns HTTP 200 OK with an HTML page root.

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8

<!DOCTYPE html><html><head><script src="/main.js"></script>...

When AI parsers encounter HTML tags and scripts instead of clean Markdown, the parsing pipeline aborts with a format error, discarding your brand facts.

2. How to Serve a Pure Markdown /llms.txt

Step 1: Place the File in /public/llms.txt

Ensure the file is served statically from your root public assets directory:

# BrandName
> Deterministic AEO and AI visibility audit platform.

## Core Tools
- [Crawler Checker](https://citedo.dev/tools/crawlability): Test 12 AI bots.
- [GEO Score](https://citedo.dev/tools/geo-score): 28-point score.

Step 2: Enforce Clean Content-Type in Next.js

Configure next.config.mjs to explicitly send text/markdown:

// next.config.mjs
export default {
  async headers() {
    return [{
      source: '/llms.txt',
      headers: [{ key: 'Content-Type', value: 'text/markdown; charset=utf-8' }]
    }];
  }
};

Generate Your Compliant llms.txt in 30 Seconds

Use CiteDo's free online generator to create validated, format-compliant llms.txt and llms-full.txt files.