I'm having an issue when trying to redirect pages based on their context root. I need to have a maintenance page come up based on a specific context root. (ex. www.builder.com/context1 & www.builder.com/context2 get redirected the the maintenance page but all other contexts don't get rewritten and vice versa) The problem I'm having is, if I use a (! not) to specify not this context root it works fine, but I can't specify the context to be redirected. Any help would be greatly appreciated.
Works
AliasMatch ^/maintenance/(.*) /opt/IBM/HTTPServer/htdocs/maintenance/$1
RewriteCond %{REQUEST_URI} !^/maintenance [OR]
RewriteCond %{REQUEST_URI} !^/context1/* [OR]
RewriteCond %{REQUEST_URI} !^/context2/*
RewriteRule ^/(.*) /maintenance/maintenance-tablets [L,R]
Does not work.
AliasMatch ^/maintenance/(.*) /opt/IBM/HTTPServer/htdocs/maintenance/$1
RewriteCond %{REQUEST_URI} !^/maintenance [OR]
RewriteCond %{REQUEST_URI} ^/context1/* [OR]
RewriteCond %{REQUEST_URI} ^/context2/*
RewriteRule ^/(.*) /maintenance/maintenance-tablets [L,R]