You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chintan Kachhi <ch...@gmail.com> on 2009/07/16 19:41:59 UTC

[users@httpd] How to get the module to work with the rewrite condition?

I am trying to redirect to my custom error page when a particular url is
hit... I am trying to follow as per this link:


http://fixunix.com/websphere/373084-use-custom-404-page-when-running-but-application-isstopped.html


where one of the relevant responses for me is what Eric had posted:

I don't believe you'll find a solution to this that has acceptable
performance.

There may be a way to do this with mod_rewrite and the LA (lookahead)
flag, but that effectively doubles the load of the traffic going to WAS.

You might look at having your administrators touch a magic file in IHS
during the redeploy of the app, and teaching mod_rewrite to return a
custom error page when that file exists.

This doc will partially help:

http://publib.boulder.ibm.com/httpse...alter_uri.html

RewriteCond /opt/IHS/conf/applicationdown.txt -f
RewriteRule ^/app1/foo /errormessage.html [PT]




I am trying the last two lines where I do a rewrite condition and the
rewrite rule.

But seems like this is not working either... is there a particular place
where the applicationdown.txt and errormessage.html files need to be?
My document root is C:/WebSphere/IBMHTTPServer/htdocs/en_US

I tried putting the applicationdown.txt file under directly under my
document root directory, but it does not work.

I also tried putting the applicationdown.txt in my IHS/conf directory as
shown in the example.
For my rewrite rule, i put:
RewriteRule ^/app1 /errormessage.html
where errormessage.html was put under my document root directory. But this
still does not work. Am I using the right directory structure to run this
module?