Re: causing HTTP error status
| From: | Richard Lynch | Date: | Sat, 06 May 2006 09:24:23 +0000 |
| Subject: | Re: causing HTTP error status | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235677@lists.php.net to get a copy of this message | ||
On Fri, May 5, 2006 3:41 am, Nic wrote:
> "Richard Lynch" <ceo@l-i-e.com> writes:
>
>> On Thu, May 4, 2006 8:50 am, Nic wrote:
>>> I'm having trouble with setting HTTP error status from PHP4.
>>>
>>> The PHP docs say that if I have this :
>>>
>>> <Directory /mydir>
>>
>> WILD GUESS!!!
>>
>> Try it with full pathname to /mydir, or perhaps without the leading
>> '/' or some combination of more/fewer directories and/or slashes.
>
> No. /mydir is the directory I want the error page served for.
>
> It does actually work outside the PHP environment, eg:
>
> <Directory /mydir>
> ErrorDocument 404 "hello!!!"
> </Directory>
>
> and requesting /mydir/not_there returns a 404 with "hello!!!" in the
> page.
>
> But /mydir/some.php doing:
>
> header("HTTP/1.1 404 Rubbish!!!")
>
> _never_ causes the error document to be picked up.
>
> It's strange because the docs say this can be done; I can't find an
> example that is purported to work outside of the docs though.
Hmmmmm.
I wonder if it only works in CGI or web SAPI but not the other.
Though I can't even guess which way that would go...
--
Like Music?
http://l-i-e.com/artists.htm