You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Joshua Chamas <jo...@chamas.com> on 2001/07/10 21:24:48 UTC

Re: How does $Response->{Status} work?

Philip Mak wrote:
> 
> I want series.asp to return a "404 Not Found" error if it gets an invalid
> $series. Right now I have:
> 
> unless (series is valid) {
>   $Response->{Status} = 404;
> }
> 
> That returns the "404 Not Found" error correctly, but it also says:
> 
> Additionally, a 404 Not Found error was encountered while trying to use an
> ErrorDocument to handle the request.
> 
> If I call an invalid URL (one that does not pass through series.asp), then
> the ErrorDocument works fine.
> 

I get this kind of error when my ErrorDocument is not properly 
defined.  I'm not sure why it would work fine when you type in 
a real 404 URL, versus setting the 404 status.

Does your access log, error log, or the source of the 404 message 
give any hint as to what ErrorDocument is trying to be found
that is failing?

If all else fails, you may try the $Response->ErrorDocument API
which can help explicity set the 404 error message?

       $Response->ErrorDocument($code, $uri)
            API extension that allows for the modification the
            Apache ErrorDocument at runtime.  $uri may be a on
            site document, off site URL, or string containing the
            error message.

-- Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks <- Web Link Checking          Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org