Skip to main content
404

Not Found

Active
RFC 9110 §15.5.5Since 1991Web, APIs, CDNs

HTTP 404 Not Found indicates the server cannot find the requested resource. Defined in RFC 9110 §15.5.5. The most recognizable HTTP error code. Does not indicate whether the absence is temporary or permanent.

Description

The 404 Not Found status code indicates that the origin server did not find a current representation for the target resource, or is not willing to disclose that one exists.

A 404 does not indicate whether the condition is temporary or permanent. If the server knows the resource was permanently removed, use 410 Gone instead – it tells search engines and clients not to request it again.

The 404 response is cacheable by default. On high-traffic sites, caching 404 responses at the CDN layer prevents repeated origin hits for invalid URLs.

Examples

Request to non-existent resource
http
GET /api/users/99999 HTTP/1.1
Host: api.example.com
404 response
http
HTTP/1.1 404 Not Found
Content-Type: application/json

{"error": "not_found", "message": "User with ID 99999 does not exist"}

Edge Cases

  • Trailing slash mismatch (/api/users vs /api/users/) is the most common unexpected 404 cause in Express, Rails, and Django. Check your router's strict slash settings.
  • Linux filesystems are case-sensitive, macOS and Windows are not – /Users/42 works in dev, breaks in production with /users/42. Always test on Linux.
  • Nginx path rewriting – the proxy may be rewriting the URL before it reaches your app. Check nginx access logs to see what path the app actually receives.
  • Soft 404s are pages that return HTTP 200 but display 'not found' content – they mislead Google, CDN caches, and monitoring tools. Return a real 404 status.
  • Some APIs return 404 instead of 403 to hide the existence of protected resources from unauthorized clients. Document this choice consistently.
  • Search engines treat persistent 404s as a signal to remove the page from the index – use this intentionally, not by accident.

When You'll See This

  • URL typed incorrectly
  • Resource was deleted without a redirect
  • Broken link from another website
  • API entity does not exist

Implementation References

LanguageConstant
Gohttp.StatusNotFound
Rusthttp::StatusCode::NOT_FOUND
Pythonhttp.HTTPStatus.NOT_FOUND
Node.jshttp.STATUS_CODES[404]
.NETHttpStatusCode.NotFound
JavaHttpURLConnection.HTTP_NOT_FOUND

History

Present since HTTP/0.9 (1991). The most culturally recognized HTTP status code. Many websites have creative custom 404 pages.

Related Status Codes

FAQ

What does HTTP 404 Not Found mean?

HTTP 404 means the server cannot find the requested resource. The URL may be wrong, the resource may have been deleted, or it may never have existed.

What is the difference between 404 and 410?

404 means 'not found' (might come back). 410 means 'gone' (permanently deleted, won't return). Search engines drop 410 pages from their index faster.