Hello,
I wonder why in some PHP scripts are two different headers to send an HTTP status.
Example:
header('HTTP/1.1 404 Not Found'); // Classic
header('Status: 404 Not Found'); // What's the point really, and why it is not often used??
Do you know the reason as to send a header with “Status:” ?
Thanks
Flexibilty of server.
See the manual entry here: [FPHP]header[/FPHP]
EDIT:
Logic
There are two special-case header calls. The first is a header that starts with the string “HTTP/” (case is not significant), which will be used to figure out the HTTP status code to send. For example, if you have configured Apache to use a PHP script to handle requests for missing files (using the ErrorDocument directive), you may want to make sure that your script generates the proper status code.
<?php header(“HTTP/1.0 404 Not Found”); ?>
For FastCGI you must use the following for a 404 response:
<?php header(“Status: 404 Not Found”); ?>
Okay, so all sites running FastCGI, must also send header header(“Status: The HTTP Status code to send”);
So I do not understand why there are so few framework and CMS that uses it.