isaac (owner)

Revisions

  • 8a522e isaac Sun Feb 08 17:23:23 -0800 2009
gist: 60596 Download_button fork
public
Public Clone URL: git://gist.github.com/60596.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Don't cause the server to break if Passenger module not loaded
<IfModule passenger_module>
  <VirtualHost _default_:80>
DocumentRoot "/opt/apps/mephisto/current/public"
RailsEnv production
# RailsAllowModRewrite off
#
# Check for maintenance file and redirect all requests
RewriteEngine On
 
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ http://%1$1 [R=301,L]
 
   RewriteCond %{REQUEST_URI} ^/assets/.*$
   RewriteRule ^/assets/(.*)$ /assets/%{HTTP_HOST}/$1 [QSA,L]
 
   RewriteCond %{REQUEST_URI} ^/$
   RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/index.html -f
   RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}/index.html [QSA,L]
 
   RewriteCond %{REQUEST_URI} ^/[^.]+$
   RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME}.html -f
   RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}%{REQUEST_FILENAME}.html [QSA,L]
 
   RewriteCond %{REQUEST_URI} ^/.+$
   RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f
   RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}%{REQUEST_FILENAME} [QSA,L]
  
RewriteCond %{REQUEST_URI} !\.(css|jpg|png|gif)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
      RewriteRule ^.*$ /system/maintenance.html [L]
<Directory "/opt/apps/mephisto/current/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
</IfModule>