Created
February 9, 2009 01:23
-
-
Save isaac/60596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment