Subscribe to PHP Freaks RSS

404 Not Found

syndicated from planet-php.net on December 11, 2018

404 Not Found hardly needs an introduction. It’s by far the most seen status by developers and non-developers alike. 404 is emitted when a resource doesn’t exist, never existed or if the server doesn’t want a client to know that a resource exist.



If the server knows the resource doesn’t and will never exist again, 410 Gone might be more appropriate.



Sometimes the 404 response is incorrectly used as a successful response to a DELETE request. The logic behind this is that the resource no longer exists after deleting, so the server should report this state.



However, this is technically wrong. Any response in the 400-499 series always means that there was a (client) error. Even successful DELETE requests should get a 200 Ok or 204 No Content response.



Example



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

<h1>404 Not found</h1>


References