[Mongrel] Apache Re-Write and Directories

HH lists at lastonepicked.com
Mon Oct 2 21:56:04 EDT 2006


I am using the 'default' Apache 2.2 mod_rewrite rules suggested from the Web
site and they are working.

One thing related to static (non cluster directed) resources:

If I have a directory in public called 'static', if I request it as follows:

http://www.domain.com/static/  - then it works

If I request it as:

http://www.domain.com/static - then it does not work as it gets directed to
the cluster.

How can I change my rewrite rules to have both of the above URLs be served
by the static resource via Apache, not by Mongrel?

Rewrite rules:

  RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /maintenance.html [L]
  # Rewrite index to check for static index.html
  RewriteRule ^/$ /index.html [QSA]
  # Rewrite to check for Rails cached pages with .html extentions
  RewriteRule ^([^.]+)$ $1.html [QSA]
  # All dynamic requests get sent to the cluster
  RewriteRule ^/(.*)$ balancer://cluster%{REQUEST_URI} [P,QSA,L]



More information about the Mongrel-users mailing list