404 Not Found
This is an educational reference page about HTTP 404 Not Found. The page itself is served as 200 OK so it can be indexed as HTTP documentation.
The origin server did not find a current representation for the target resource, or is not willing to say that one exists.
Specification
Registered in the IANA HTTP Status Code Registry as Not Found. Defined in RFC 9110, Section 15.5.5.
What it means
HTTP 404 Not Found means the server has no current representation for the requested URL, or does not want to reveal that one exists. A 404 says nothing about whether the condition is temporary or permanent. When the server knows the resource is gone for good, RFC 9110 prefers 410 Gone.
When to use it
- Return 404 when the URL does not match any route or file.
- Return 404 when the route exists but the record does not, such as /api/users/999 for a user ID that was never created.
- Return 404 instead of 403 when telling the client that a private resource exists would leak information.
Common causes
- A typo in the URL, or a link to a page that was moved without a redirect.
- A deleted record or file.
- A missing trailing slash, or the wrong letter case on a case-sensitive server.
- A single-page app route that the static host does not know about, so a reload returns 404.
How to fix it
- Check the URL for typos, trailing slash, and letter case.
- When a page moves, add a 301 or 308 redirect from the old URL.
- For single-page apps on static hosting, configure a fallback to index.html for app routes.
- Return 410 for content you removed on purpose and do not plan to bring back.
Examples
API record not found
GET /api/users/999 HTTP/1.1
Host: api.example.com
HTTP/1.1 404 Not Found
Content-Type: application/problem+json
{
"type": "https://api.example.com/problems/not-found",
"title": "User not found",
"status": 404
}
Common mistakes
- Serving a "page not found" page with status 200. Search engines call this a soft 404, and monitoring tools see a success.
- Returning 404 for an empty collection. GET /api/orders with no orders is 200 with an empty list.
- Caching 404 responses for a long time. 404 is heuristically cacheable, so a URL that starts working can keep returning 404 from a cache. Set Cache-Control on 404 responses when the content may appear soon.
Developer notes
404 is the safe default when you are unsure. It reveals the least, and it does not commit you to saying the resource is gone forever. Switch to 410 when you know the removal is permanent and you want caches and crawlers to drop the URL.
Questions
What does HTTP 404 Not Found mean?
HTTP 404 means the server has no current representation for the requested URL, or will not say whether one exists.
What is the difference between 404 and 410?
404 does not say whether the resource will come back. 410 says it is gone and the condition is likely permanent.
Is 404 bad for SEO?
No. 404 is the correct response for URLs that do not exist. Redirect URLs that moved, and avoid soft 404s that return 200.
See also
Header and content rules
RFC 9110 adds no header or content rule specific to 404. The 4xx class rules also apply. See 404 in the response obligations table.