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.
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.
- 1User mistyped a URL.
- 2A link on a page is broken, pointing to a deleted resource.
- 3The resource was moved without setting up a redirect.
- 4The requested file or API endpoint does not exist on the server.
A user attempts to access a webpage that has been deleted from the server.
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.
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.
// 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.
// Example in a web server configuration (Nginx) error_page 404 /custom_404.html;
Why this works
Server Configuration
✕
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev