HTTP Status Codes

404 404 Not Found

The requested resource could not be found on the server.

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

1

Common Cause

Broken or mistyped URL links

2

Common Cause

Deleted or moved pages without redirects

3

Common Cause

Missing API routes or endpoints

4

Common Cause

Incorrect file paths for static assets

5

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>
  )
}
6

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:

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.