Logo
DevUtilsAll-in-one toolkit
Back to all codes
4044xx
4xx — Client Error

Not Found

The server can not find the requested resource.

What it means

The HTTP 404 Not Found client error response code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often called broken or dead links.

404s can also be used to hide the existence of a resource from an unauthorized client, rather than returning a 403 Forbidden.

How it works

  • 1The client makes a request to a URL.
  • 2The server's router cannot match the URL to any file, endpoint, or dynamic route.
  • 3The server returns a 404 error.

Why you're seeing this

  • Typo in the URL.
  • The resource was deleted.
  • Routing configuration error.

How to fix it

  • Implement custom, helpful 404 pages that guide users back to valid content. If a resource moved permanently, use a 301 instead.

Framework Implementations

Next.js

import { notFound } from 'next/navigation';

export default async function Profile({ params }) {
  const user = await getUser(params.id);
  if (!user) notFound();
  return <div>{user.name}</div>;
}

Real-Life Scenarios

Use this whenever a requested URL or database record simply does not exist.

Typo in URL

A user types /abotu instead of /about. The server can't find it and returns a 404 page.

HTTP Transaction

1. Client Request

GET /non-existent-page HTTP/1.1
Host: example.com

2. Server Response

HTTP/1.1 404 Not Found
Content-Type: text/html

<h1>Page Not Found</h1>

SEO Implications

Search engines remove 404 pages from their index. If a page was moved, use 301 instead so you don't lose the SEO value.

Related Codes