I am trying to get a maintenance page setup for a suburi deployment on Phusion Passenger for a rails app. All the documentation shows DocumentRoot ReWrite rules, which don't appear (don't think they should) rewrite on suburis. I tried hacking around on the ReWrite rules to point at the suburi, but I can't seem to get it to work. Has anyone been able to get a setup which works?
I am having exactly the same problem. Although I am using the before filter way, I actually hate this method.
assume app1 and app2 is one of my sub-uri
RewriteEngine On
RewriteCond %{REQUEST_URI} !.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/$1/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^/([^/]+)(/|/.*)?$ /$1/system/maintenance.html [L]
RailsBaseURI /app1
RailsBaseURI /app2