views:

357

answers:

1

I have configured Apache to look for the presence of a maintenance page and redirect to that page if it is present:

RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.
RewriteRule ^.*$ /system/maintenance.html [L]

This is fairly standard practice for deploying Ruby on Rails apps.

What I'd like to do to create a URL exclusion list so the redirect doesn't occur for specific subdomains, e.g: https://user1.myapp.com/any_request_url or https://user2.myapp.com/any_request_url

Can this be achieved with extra RewriteCond statements?

+3  A: 

This should do it:

RewriteCond %{HTTP_HOST} !^(user1|user2)\.myapp\.com$
Tomalak