Re: causing HTTP error status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Rabin Vincent" <rabin@xxxxxx> writes:

> In PHP, mod_php itself is the handler. It doesn't allow your script
> access to the Apache API in the way that mod_python does. Looking
> at the sapi code in PHP, it seems to returns OK to Apache
> regradless of what goes on in the called script (i.e, it's not parsing
> the headers emitted, if any). Thus, throwing a 404 header in
> your script will not invoke Apache's ErrorDocument, since Apache
> doesn't know anything is wrong.

You're absolutely right - that is what is happening.

In fact in mod_python one has to raise an exception with the return
value to get the error page to be served. I can't remember how it
works in mod_perl.


I had an expectation that PHP would be parsing the returned header and
internally redirecting to the errordocument if necessary.

I guess that doesn't make any sense because the page the error is
generated from might have content that shouldn't be discarded.


It might make sense to do this on exit(x) if x>0 but I'm not sure.


Nic

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux