404 Not Found
What a 404 actually means, why it is not the same as 410, and what to check when you get one you did not expect.
Runs in your browser
Click a code to copy it.
The request was wrong, or not allowed. Changing the request may help.
| Code | Meaning |
|---|---|
| Bad Request | The server could not understand the request at all. |
| Unauthorized | You are not authenticated. The server does not know who you are.Misnamed: 401 means unauthenticated. 403 is the one that means unauthorised. A 401 must carry a `WWW-Authenticate` header. |
| Forbidden | The server knows who you are and you still may not have this.Logging in will not help. If the existence of the resource is itself secret, 404 is the safer answer. |
| Not Found | There is nothing at this address.Says nothing about whether it ever existed. Use 410 when you know it is gone for good. |
| Method Not Allowed | The address exists but not for this verb. The reply must list the ones that work. |
| Conflict | The request clashes with the current state — an edit against a newer version, for example. |
| Gone | It existed and has been deliberately removed. It is not coming back. |
| I'm a teapot | An April Fools joke from 1998 that never left. |
| Unprocessable Content | Well-formed, but semantically wrong — valid JSON with an invalid field. |
| Too Many Requests | You are being rate limited. `Retry-After` says when to come back. |
No status code matches that.
What it actually says
A 404 says one thing: there is nothing at this address.
It deliberately says nothing about whether there ever was, whether there might be later, or whether you would be allowed to see it if there were. That vagueness is a feature — it is what lets a server hide the existence of something without admitting that it is hiding anything.
404 or 410
If you know the thing existed and has been removed on purpose, 410 Gone is the better answer. It is a stronger statement: not “I cannot find this” but “this is deliberately gone.”
The practical difference is crawling. Search engines treat a 404 as possibly temporary and will come back for a while; a 410 tells them to stop, and pages drop out of the index faster. If you are retiring URLs on purpose, 410 does what you mean.
Use 404 when you genuinely do not know — which is most of the time, because most servers cannot distinguish “never existed” from “deleted last year”.
When you did not expect one
In rough order of how often it turns out to be the cause:
- A trailing slash.
/aboutand/about/are different URLs, and many servers only route one. - Case. Paths are case-sensitive on Linux servers and not on macOS or Windows, so a link that works locally can 404 in production.
- The route exists but the method does not. Some frameworks return 404 rather than the correct 405 Method Not Allowed for a POST to a GET-only route, which sends you looking in the wrong place entirely.
- A rewrite or redirect rule matching earlier than you expect.
- A single-page app with no server-side fallback: the route works when you navigate to it in the app and 404s when it is loaded directly.
404 pages should still be 404
A custom error page is good. Serving it with a 200 status is not — that is a “soft 404”, and it tells every crawler that a page full of “not found” is real content worth indexing. Set the status as well as the page.
Keep the page useful: a search box and a link to the section the URL was in beats an apology.