Forum Moderators: phranque
SRVE0255E: A WebGroup/Virtual Host to handle localhost:80 has not been defined.
I want to be able to redirect to my custom error message, based on the response, rather than show this error message. Trying to use the ErrorDocument directive within the httpd.conf file does not work,... but I have heard that this is possible to do with mod_rewrite. I am not sure how to do this.
I'd suggest looking into the mechanism that you use to 'map' URLs to your 'services' and making that mechanism 'aware' or the services that have been removed. If a service has been removed, then (dependping on your server version and the 'mapping' mechanism you use) either rewrite removed-service URLs to a non-exsistent filepath or directly return a 410 or 404 response.
Alternately, do not 'remove' any services, but instead replace them with a script that will directly return a proper 410-Gone status response.
Overall the proposed method is 'closing the barn door after the horses have fled' in that mod_rewrite works in the URL-to-filename translation phase of the API as a request is received from the client; By the time the server knows the response (after the content-handling phase), it is far too late to run mod_rewrite.
Jim
Also, do not overlook what I said above. It may just be loose terminology use, but do not "redirect" to an error page. Either serve one up directly, or 'include' it for output by a script.
It sounds to me like you'll need to put a 'wrapper' around your back-end requests: Take an incoming client request for a 'service' and rewrite it to a front-end script. Have that script forward the request to the back-end app server, and then accept the back-end's response. Then examine that response and either return the back-end's output or an error response (as appropriate) to the client.
Jim
Also, I am not using any proxy or so to connect, so I don't think I would probably need to use ProxyErrorOverride.
front end server( IBM Http server)
That is a fork of apache httpd but with modifications and is closed-source. Unless they use their own connector protocol they'll likely proxy via http to connect the backend server. A way to modify responses at apache httpd 2+ are output filters with a tiny module.
I have been trying to find some way using the mod_rewrite module which can force it to scan the response.