Results 1 to 4 of 4
Thread: HTTP Header issue
Aug 6, 2012, 04:44 #1
HTTP Header issue
I wonder why in some PHP scripts are two different headers to send an HTTP status.
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??
Aug 6, 2012, 04:49 #2
Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.
- Join Date
- Feb 2006
- Atlanta, GA, USA
- 46 Post(s)
- 0 Thread(s)
Aug 6, 2012, 04:50 #3
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"); ?>Logic without the fatal effects.
All code snippets are licensed under WTFPL.
Aug 6, 2012, 05:01 #4
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.