HTTP 404 Not Found — What It Means and How to Fix It
A 404 status code means the server couldn't find the requested resource. Learn the common causes on both client and server side, and how to debug it.
Published September 20, 2026
HTTP 404 Not Found is a client-error status code meaning the server couldn't find any resource matching the requested URL. It doesn't necessarily mean the resource never existed — only that the server has no current mapping for that path.
Common causes
- The URL was typed incorrectly or a link points to a path that was moved, renamed, or removed
- A single-page application's client-side routes aren't configured on the server, so a direct visit or refresh to a deep link returns 404 instead of falling back to index.html
- A REST API endpoint path or an ID in the URL doesn't correspond to any existing record
How to fix it
- Double-check the requested URL for typos and confirm it matches the actual route/file structure on the server
- For single-page apps deployed as static files, configure the web server to rewrite unknown paths to index.html (a 'catch-all' fallback) so client-side routing can take over
- For APIs, return 404 deliberately when a resource genuinely doesn't exist (e.g. GET /users/999 for a non-existent user) rather than a generic error
Example
HTTP/1.1 404 Not Found
Content-Type: application/json
{"error": "User not found"}FAQ
Is 404 the right code for 'the resource exists but you can't access it'?
No — that's 403 Forbidden. Some APIs deliberately return 404 instead of 403 for private resources to avoid revealing that the resource exists at all.