Forum: Ruby on Rails rewriterule muck up

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2007-05-09 23:13
(Received via mailing list)
ok, want to have my nice rails/mongrel app show a maint page when
available...

trying to do something like this...
http://jonathan.tron.name/articles/2006/07/26/apac...

my vhost rewrite rules are...
  RewriteEngine On
  RewriteLog /var/log/apache2/rewrite_engine_log
  RewriteLogLevel 3
  RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /maintenance.html [L]

my rewrite log is...
127.0.0.1 - - [09/May/2007:13:55:07 --0500] [/sid#81d0960][rid#836a748/
initial] (1) pass through /
127.0.0.1 - - [09/May/2007:13:58:11 --0500] [/sid#81d0960][rid#836a748/
initial] (2) init rewrite engine with requested uri /
127.0.0.1 - - [09/May/2007:13:58:11 --0500] [/sid#81d0960][rid#836a748/
initial] (3) applying pattern '^.*$' to uri '/'
127.0.0.1 - - [09/May/2007:13:58:11 --0500] [/sid#81d0960][rid#836a748/
initial] (1) pass through /

SOOO....it just passes on thru everything, uggg

Any Rewrite experts out there ?
Philip H. (Guest)
on 2007-05-09 23:43
(Received via mailing list)
> 
http://jonathan.tron.name/articles/2006/07/26/apac...
>
> my vhost rewrite rules are...
>  RewriteEngine On
>  RewriteLog /var/log/apache2/rewrite_engine_log
>  RewriteLogLevel 3
>  RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
>  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
>  RewriteRule ^.*$ /maintenance.html [L]

You have a typo... or at least don't have the same code he has... his
file
is in the /system directory...  Here's the configs I've used in the past
that have worked for me when public/system/maintenance.html exists...

   # Check for maintenance file and redirect all requests
   #  ( this is for use with Capistrano's disable_web task )
   RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
   RewriteCond %{SCRIPT_FILENAME} !maintenance.html
   RewriteRule ^.*$ /system/maintenance.html [L]

-philip
(Guest)
on 2007-05-11 06:41
(Received via mailing list)
Yeah, I have mine in public/maintenance.html, I did try moving it to
system under he superstition that maybe that mattered, but it did
not.  The really confusing thing is that the rewrite log says
"comparing to /^.*$/ (ie everything), and then passing thru, come on,
it's gotta match !
This topic is locked and can not be replied to.