I’ve found that header('HTTP/1.1 404'); works just as well as header('HTTP/1.1 404 Not Found'); in PHP. So I looked in the specification, but couldn’t find anything about it;
Is the HTTP status header description optional?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The description can be any human-readable string. Clients may not depend on the string and they must only check the code.
However, as usual clients aren’t always complying. Browsers will probably do fine, but you can bet that there’s HTTP clients out there that specifically check for the string.
HTTP/1.1 says:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
But HTTPbis clarified it with stronger wording:
https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-p1-messaging-16#section-5.1.1