httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schermuly-Koch, Achim" <>
Subject AW: [users@httpd] Intercepting Error Responses from a handler
Date Wed, 28 Apr 2010 20:34:32 GMT
>> 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
>> 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


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message