AW: Intercepting Error Responses from a handler

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

 



>> i have an apache setup using a proprietary handler (let's call it "my-handler")
>> to render the content
>>
>> <Location "/mypages">
>>   SetHandler my-handler
>> </Location>
>>
>> This is similar to using a php-script handler, i guess.
>>
>> Now the handler does some URI resolution magic, thus it might return a
>> 404-not found response. I would like to intercept these (and 500, 401,
>> etc. as well) and display some custom error message.
>>
>> I tried
>
>> ErrorDocument 404 /notfound.html
>
>> But that does only work for pages not beginning with "/mypages" because
>> apache does not find them. However, if i request "/mypages/nonexistent.html" which is
>> handled by "my-handler" I just see a boring 404 rendered by the handler.
>
>> Is there any way to intercept this one _easily_? I could imagine, I could set
>> up a proxy - at least I have found some documentation about intercepting in mod_proxy. >> But I really like to keep things simple (and fast).
>>
>> If mod_proxy would be the only solution, is it possible to set up this
>> "in situ", I mean on the one and same apache hosting the "my-handler"

> Since you have to write the custom response page anyway, why not have
> my-handler return it directly as a response?

For various reasons:

1. I would like to keep things simple and centralized. I would need the
   error page on the apache anyway, in case a user types in a URL, that is not
   handled by "my-handler" - thus I don't want to deploy the error pages twice.

2. I want a to show the errorpage in case my-handler is down

3. I want the error page on the apache in case the handler renders crap
   or leaks a stacktrace

4. I want to use the handler as an out of the box / black box, with
   as few customizations as possible


achim

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux