What Is This?
The HTTP 404 Not Found status code indicates that the server cannot find the requested resource. It is the most common HTTP error on the web. 404 does not distinguish between a resource that never existed and one that was deleted — it simply means the server cannot find anything at the requested URL. Links to deleted pages, mistyped URLs, and moved resources without redirects all result in 404.
Common Causes & Solutions
Common Cause
Broken or mistyped URL links
Common Cause
Deleted or moved pages without redirects
Common Cause
Missing API routes or endpoints
Common Cause
Incorrect file paths for static assets
Create a helpful custom 404 page
Design a 404 page that helps users find what they are looking for instead of hitting a dead end.
// Next.js 404 page
import Link from 'next/link'
export default function NotFound() {
return (
<div className="flex flex-col items-center justify-center min-h-[50vh]">
<h1 className="text-4xl font-bold">404</h1>
<p className="text-muted-foreground mt-2">Page not found</p>
<Link href="/" className="mt-4 text-primary hover:underline">
Go home
</Link>
</div>
)
}Implement proper redirects
When moving or deleting content, use 301 redirects to point old URLs to their new locations. This preserves SEO value and prevents user frustration.
Related Entries
More from this reference:
400 400 Bad Request
The server cannot process the request due to client-side input errors.
401 401 Unauthorized
Authentication is required but was missing or invalid.
403 403 Forbidden
The client is authenticated but does not have permission to access the resource.
405 405 Method Not Allowed
The HTTP method used is not allowed for this resource.
408 408 Request Timeout
The server timed out waiting for the client to send the complete request.
413 413 Payload Too Large
The request body exceeds the server's maximum allowed size.
422 422 Unprocessable Entity
The request has valid syntax but contains semantic validation errors.
429 429 Too Many Requests
The client has exceeded the rate limit and should slow down.
Frequently Asked Questions
Should 404 return a custom page or a blank response?
Always return a custom 404 page with navigation options. A blank or generic error page frustrates users and increases bounce rates. Include search, navigation, and links to popular pages.
Is it bad for SEO to have 404 pages?
404 pages themselves do not harm SEO. What hurts SEO is having important pages return 404 instead of 301 redirects. For deleted pages, use 301 redirects to related content rather than letting them become dead links.