Friday, November 12, 2010

Apache Rewrite Rule for outage notification.

Apache rewrite rule to redirect all application specific URLs to an outage page during maintenance. Make sure that modules/mod_rewrite.so module is loaded and turned on.

...
RewriteEngine On
...

Also make sure that this rule is ahead of any other rules in the conf file.
...
RewriteRule (^/context.*$|^/cxt2.*$) /outage/reason.html [R,L]
....
 
R - to send HTTP redirection.
L - this is the last rule to be evaluated.

No comments: