Mailing List Archive

Status and ErrorDocument
Hi all,

when i try to use

$Response->ErrorDocument (404, '/notfound.page')

in combination with

$Response->Status (404)

i do not get my "notfound page", but a 404 Apache error message
combined with an additional 404 message:

..
Not Found
The requested URL /test.asperl was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.
..

ErrorDocument together with a string like in the examples works well, but
not with an url.
The same is when i set

ErrorDocument 404 /notfound.html

in the httpd.conf in combination with $Response->Status(404).
On the other side without ASP when im trying to access a non existing
"normal" html page this works.


Any ideas?

Helmut

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Status and ErrorDocument [ In reply to ]
Helmut Zeilinger wrote:
> Hi all,
>
> when i try to use
>
> $Response->ErrorDocument (404, '/notfound.page')
>
> in combination with
>
> $Response->Status (404)
>
> i do not get my "notfound page", but a 404 Apache error message
> combined with an additional 404 message:
>

I don't know why this would not work for you. Apache::ASP uses
Apache->request->custom_response($code, $uri) internally, and you
might try that API directly.

If nothing ends up working for you, you might try first doing a:

my $error_text = $Response->TrapInclude('notfound.page');
$Response->ErrorDocument(404, $$error_text);

Regards,

Josh

________________________________________________________________________
Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
http://www.chamas.com | Apache::ASP - http://www.apache-asp.org



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Status and ErrorDocument [ In reply to ]
--On Friday, April 30, 2004 19:43:04 -0700 Josh Chamas <josh@chamas.com>
wrote:

> Helmut Zeilinger wrote:
>> Hi all,
>>
>> when i try to use
>>
>> $Response->ErrorDocument (404, '/notfound.page')
>>
>> in combination with
>>
>> $Response->Status (404)
>>
>> i do not get my "notfound page", but a 404 Apache error message
>> combined with an additional 404 message:
>>
>
> I don't know why this would not work for you. Apache::ASP uses
> Apache->request->custom_response($code, $uri) internally, and you
> might try that API directly.
>
> If nothing ends up working for you, you might try first doing a:
>
> my $error_text = $Response->TrapInclude('notfound.page');
> $Response->ErrorDocument(404, $$error_text);
>

Of course that would work..

I did some trying:
It works perfect when i comment out line 459 in ASP/Response.pm (Version
2.57)

..
$r->status($status) if defined($status);
..

at least what this particular problem concerns..


Regards

Helmut

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