404
HTTPERRORNotable4xx Client ErrorHIGH confidence

Not Found

Production Risk

Moderate. Frequent 404 errors can lead to a poor user experience, broken functionality, and negative SEO impact from search engine crawlers.

What this means

The server cannot find the requested resource. This is one of the most common errors on the web. It means the URL is not recognized or the resource does not exist at that location.

Why it happens
  1. 1User mistyped a URL.
  2. 2A link on a page is broken, pointing to a deleted resource.
  3. 3The resource was moved without setting up a redirect.
  4. 4The requested file or API endpoint does not exist on the server.
How to reproduce

A user attempts to access a webpage that has been deleted from the server.

trigger — this will error
trigger — this will error
curl -I https://example.com/non-existent-page

expected output

HTTP/1.1 404 Not Found

Fix 1

Correct the URL

WHEN If you are the client and suspect a typo.

Correct the URL
Check the URL for spelling errors and try again.

Why this works

User Correction

Fix 2

Implement a 301 Redirect

WHEN If a resource was permanently moved on the server.

Implement a 301 Redirect
// Example using Express.js
res.redirect(301, "/new-location/of-resource");

Why this works

Server-Side Redirect

Fix 3

Create a Custom 404 Page

WHEN To provide a better user experience for all Not Found errors.

Create a Custom 404 Page
// Example in a web server configuration (Nginx)
error_page 404 /custom_404.html;

Why this works

Server Configuration

What not to do

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All HTTP errors