Not Found
Client Error (4xx)The 404 Not Found status code indicates that the server cannot find the requested resource. This is the most well-known HTTP error and can mean the URL is wrong, the resource has been deleted, or the resource never existed. The server makes no indication of whether the condition is temporary or permanent. For permanently removed resources, use 410 Gone instead.
What is HTTP 404 Not Found?
HTTP 404 Not Found is a client error (4xx) status code. The 404 Not Found status code indicates that the server cannot find the requested resource. This is the most well-known HTTP error and can mean the URL is wrong, the resource has been deleted, or the resource never existed. The server makes no indication of whether the condition is temporary or permanent. For permanently removed resources, use 410 Gone instead. Common causes include incorrect url or typo in the path and resource has been deleted or moved. To fix it, verify the url is correct and check for typos.
Example Response
HTTP/1.1 404 Not Found
Content-Type: application/json
{"error": "The requested resource was not found"} Common Causes
- • Incorrect URL or typo in the path
- • Resource has been deleted or moved
- • Broken link from another page
- • Missing route in the application
- • Case sensitivity mismatch in the URL
How to Fix
- 1. Verify the URL is correct and check for typos
- 2. Check if the resource was moved and set up a redirect
- 3. Update or remove broken links pointing to this URL
- 4. Add the missing route or page to your application
- 5. Check URL case sensitivity (Linux servers are case-sensitive)
Frequently Asked Questions
How do I create a custom 404 page?
Most web servers and frameworks support custom error pages. In nginx, use error_page 404 /404.html. In Express.js, add a catch-all middleware at the end of your routes. In Next.js, create a pages/404.js file.
Does a 404 hurt SEO?
A few 404 pages are normal and do not hurt SEO. However, many 404 errors can indicate a poorly maintained site. Use Google Search Console to find and fix 404 errors, especially for pages with incoming links.
What is the difference between 404 and 410?
404 means the resource was not found (may or may not have existed). 410 Gone means the resource existed but has been permanently removed. 410 tells search engines to remove the URL from their index more quickly.