# Don't cause the server to break if Passenger module not loaded 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] Order allow,deny Allow from all