HTTP status code 404 is one of the most common HTTP status codes, indicating that the server cannot find the resource requested by the client. This typically means that the requested webpage or file does not exist or has been removed.
Causes of 404 Error
- Incorrect URL: The URL requested by the client may be misspelled or have changed.
- Resource Removed: The requested resource may have been deleted or moved to another location.
- Server Configuration Issues: The server may not be properly configured to handle the request.
When the server returns a 404 status code, it usually includes an error page in the response body, explaining that the requested resource cannot be found. This error page may provide information on how to locate the resource or include a link back to the website’s homepage.
For example, the server might send the following response:
HTTP/1.1 404 Not Found
Content-Type: text/html
Content-Length: 169
<html>
<head><title>404 Not Found</title></head>
<body>
<h1>Not Found</h1>
<p>The requested URL /missing-page was not found on this server.</p>
<hr>
<address>Apache/2.4.1 (Unix) Server at www.example.com Port 80</address>
</body>
</html>
In this example, the status code 404 indicates that the server cannot find the requested resource /missing-page
. The response body contains a simple HTML page informing the user that the requested resource was not found.
When the client receives a 404 error, it can:
- Check if the URL was entered correctly.
- Use the website’s search function to locate the resource.
- Return to the website’s homepage and try to find the correct link.
- Contact the website administrator or owner for assistance if they believe the resource should exist.
The 404 error is temporary; if the resource is re-uploaded or the URL is corrected, future requests for that resource may succeed.
Related 4xx error code
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Payload Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I’m a teapot
- 421 Misdirected Request
- 422 Unprocessable Entity (WebDAV)
- 423 Locked (WebDAV)
- 424 Failed Dependency (WebDAV)
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request