Forum Moderators: phranque
Now, that's just not right :).
What I have is my 404 page set up as 'redirect.php'. That php script checks a database of page mappings, and if found is supposed to generate a 200 (page found) and generate the page. That way I can have URL mappings done right out of the database. If the page address isn't found in the database, we dump out a 404 not found.
It used to work fine - 404's when expected, 200's when expected. Not now - now when I expect a 404 I get that weird thing.
Any idea what would be causing that combination of codes header? I don't recall changing anything in the code.
Or, is the server sending 200 for finding the script, and then the script is sending 404 after that, and the server is combining them?
I really really really do not like "redirect" scripts for sending errors, they often break the proper HTTP processes - as you have found.
It is quite common to find a "404 Error" that actually sends a 302 followed by a separate 200 - and that is very broken.
I actually was going to refer back to your thread, but then remembered that you were using PERL.
In both cases, I believe the problem is that the "Status" response is a preamble to the HTTP response headers -- That is, it is much like a doctype declaration in HTML; The status response precedes the HTTP headers, but is not considered to be an HTTP header itself, much as a doctype precedes an HTML document, but is not HTML markup itself.
Therefore, I suspect that a "special" form of the "output a header function" must be used in both scripting languages, in order to send a properly-formatted HTTP status.
Also, the problem may have to do with running the script interpreters as cgi versus as installed modules... Did anybody's server get upgraded recently?
I'm hoping you guys find solutions, and post them back here. If so, I may do some editing to add some strong keywords to these threads, so that others can find them easily... :)
Jim