404 vs 451: Not Found vs Unavailable For Legal Reasons
404 and 451 can look similar in logs, but they tell clients, crawlers, and API consumers different things.
| Aspect | HTTP 404 — Not Found | HTTP 451 — Unavailable For Legal Reasons |
|---|---|---|
| Definition | The server found no resource matching the requested URL. It does not indicate whether the resource ever existed or whether it might exist in the future. | Named after Ray Bradbury's "Fahrenheit 451." The server is denying access due to a legal obligation (government order, court injunction, DMCA takedown, etc.). Defined in RFC 7725. |
| Plain-language summary | The server cannot find any resource at the requested URL. The URL may have never existed, the resource may have been deleted, or the URL may be typed incorrectly. The server makes no guarantee about whether the resource might exist in the future. | HTTP 451 Unavailable For Legal Reasons indicates the resource is blocked due to a legal demand. |
| When to use | Return 404 when no resource exists at the requested URL. Use 410 Gone when the resource existed and has been intentionally, permanently removed (helps crawlers delist faster). Use 403 when the resource exists but access is denied. Avoid soft 404s (returning 200 with "page not found" content) — search engines treat them as indexed pages. | HTTP 451 Unavailable For Legal Reasons indicates the resource is blocked due to a legal demand. |
| Client behavior | No automatic retry. Browser displays the 404 error page. Crawlers record the URL as not found and typically delist it after repeated 404 responses. API clients should surface the error and not retry. | Client handles 451 according to client-errors semantics. |
| Caching behavior | May be cached if the server includes a Cache-Control header, but this is rarely appropriate. Most servers do not cache 404s. CDNs may cache 404s if Cache-Control: max-age is present — be careful with CDN 404 caching for dynamic routes. | See 451 caching spec. |
| SEO / crawler impact | Search crawlers interpret 404 (client-errors) for indexation and link equity accordingly. | Search crawlers interpret 451 (client-errors) for indexation and link equity accordingly. |
| API / backend impact | API clients branching on 404 expect Not Found semantics. | API clients branching on 451 expect Unavailable For Legal Reasons semantics. |
| Safe to retry? | Only after fixing the underlying cause | Only after fixing the underlying cause |
Common real-world scenarios
When you see HTTP 404
A baseline of 404s is normal (bad links from external sites, typos, old URLs). Alert on: sudden spikes in 404s (deployment broke routes), 404s on URLs that were recently 200 (routing regression), and systematic 404s on specific URL patterns (broken redirect or routing rule).
When you see HTTP 451
451 appears in production when: Government-mandated content block; Court-ordered takedown.
Decision rule
Use 404 when the response should communicate not found behavior; use 451 when unavailable for legal reasons is the accurate protocol signal.
A frequent mistake is swapping 404 and 451 for convenience; that causes client retry bugs, incorrect cache signals, and misleading monitoring data.
Use 404 when the correct protocol signal is Not Found. Use 451 when the correct signal is Unavailable For Legal Reasons. Returning either code for the wrong reason breaks client expectations, cache behavior, and monitoring accuracy.
FAQ
What is the biggest difference between 404 and 451?
404 communicates Not Found, while 451 communicates Unavailable For Legal Reasons. Choosing the right one keeps clients and intermediaries predictable.
Do 404 and 451 have SEO or caching impact?
Yes. Search engines and caches interpret status classes differently. Use each code according to its semantics to avoid accidental indexing, stale responses, or crawl inefficiency.
Can APIs safely return 404 instead of 451?
Only when it matches contract semantics. API clients often branch logic by exact code, so swapping them can break retries, auth handling, or user-facing errors.
Full guides
HTTP 404 Not Found — full guide · HTTP 404 status reference · HTTP 451 Unavailable For Legal Reasons — full guide · HTTP 451 status reference · All comparisons