Capistrano and Passenger part 2

As Karl Varga pointed out in his comment on my previous post on Capistrano and Passenger (here) my apache rewrite rules did not send back the proper HTTP status codes. Now with the improved and tested rules the 503 status code is returned.

ErrorDocument 503 /system/maintenance.html

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
# RewriteCond %{REQUEST_URI} !^/images/
# RewriteCond %{REQUEST_URI} !^/robots.txt
# RewriteCond %{REQUEST_URI} !^/sitemap
RewriteRule ^.*$ – [redirect=503,last]

If your maintenance page has images on it than you can enable line 6 by removing the ‘#’.

See also Chris K’s article.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>