# Fix: Unknown paths return HTTP 404 or 410

> Web-audit fix skill for the `agent-friendly-404` check (Discoverability, SHOULD).

## Goal

Return a real HTTP 404 or 410 for unknown paths instead of a 200 SPA shell.

## Fix

Configure the origin so a nonsense path under the site returns HTTP 404 or 410, not 200 with
the application shell. A soft-404 hides recovery from agents: they treat the page as content
and never look for a sitemap or `llms.txt`. Verify with
`curl -sS -o /dev/null -w "%{http_code}" https://example.com/this-path-does-not-exist` — it
MUST print `404` (or `410`).

## Resources

- [RFC 9110 status codes](https://www.rfc-editor.org/rfc/rfc9110#name-status-codes)

## Copy-paste prompt

Paste this into your coding agent. [Your audit](https://anc.dev/audit) adds what it observed for this check:

```text
Goal: Return a real HTTP 404 or 410 for unknown paths instead of a 200 SPA shell
Fix: Configure the origin so a nonsense path under the site returns HTTP 404 or 410, not 200 with the application shell. A soft-404 hides recovery from agents: they treat the page as content and never look for a sitemap or `llms.txt`. Verify with `curl -sS -o /dev/null -w "%{http_code}" https://example.com/this-path-does-not-exist` — it MUST print `404` (or `410`).
Skill: https://anc.dev/fix/agent-friendly-404
Docs: https://www.rfc-editor.org/rfc/rfc9110#name-status-codes
```

## Verify

Re-run the audit at [https://anc.dev/audit](https://anc.dev/audit) or call the `audit_website` MCP tool; the `agent-friendly-404` check should report `pass`.
