404 Not Found
Client Error - Requested resource doesn't exist
HTTP 404 Not Found
What It Means
The HTTP 404 Not Found status code indicates that the server cannot find the requested resource. This is one of the most recognized status codes — the page simply doesn't exist at that URL.
Common Causes
- Typo in URL: User or link has incorrect path
- Deleted page: Resource was removed without redirect
- Moved without redirect: URL changed but no 301 set up
- Broken link: External site links to non-existent page
- Case sensitivity: /Page vs /page on case-sensitive servers
- Missing file extension: .html required but not provided
- API route not defined: Endpoint doesn't exist
SEO Impact
404s themselves don't hurt SEO — they're a normal part of the web. However:
- Broken internal links waste crawl budget
- Lost backlinks lose link equity
- Poor user experience increases bounce rate
Fix: Set up 301 redirects for moved/deleted pages with backlinks.
Example Response
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"error": "Not Found",
"message": "The requested resource was not found",
"path": "/api/users/999"
}
Custom 404 Pages
Nginx
server {
error_page 404 /404.html;
location = /404.html {
root /var/www/html;
internal;
}
}
Next.js
// pages/404.js
export default function Custom404() {
return <h1>404 - Page Not Found</h1>
}
Express.js
// 404 handler (must be last)
app.use((req, res) => {
res.status(404).json({
error: 'Not Found',
path: req.path
});
});
404 vs 410
| Code | Meaning |
|---|---|
| 404 | "I don't know if this ever existed" |
| 410 | "This used to exist but was intentionally removed" |
Good 404 Page Practices
- Include search functionality
- Link to popular pages or homepage
- Keep the same site navigation
- Make it clear it's a 404 (don't return 200)
- Log 404s to find broken links