views:

773

answers:

1

Hi, I am trying to use mod_rewrite to be able to redirect to my custom html error page, when a 404 is returned. Right now, I have my http server running and my appserver(Websphere) running. When I take down a service on the appserver, it returns a message as follows:

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.

A: 

Have you tried smth like this:

ErrorDocument 404 /not-found.asp
TonyCool
I tried that does not work.
What seems to be happening is that 404 response is being returned to the app server( Websphere) and not the front end server( IBM Http server) that lies in front of it. The plugin connecting the two of them probably just sees that it gets the response. So it is not going to look at the response but will just forward it to the front end server( the http server). The http server sees that it received a response, but does not try to see that the response that it received is a 404, and hence does not display error page.
I have been trying to find some way using the mod_rewrite module which can force it to scan the response. Or some way for the plugin to recognize it as a 404 and pass it to the http server as a 404?