Skip to content

Instantly share code, notes, and snippets.

@jjulian
Created February 23, 2012 03:38
Show Gist options
  • Save jjulian/1889874 to your computer and use it in GitHub Desktop.
Save jjulian/1889874 to your computer and use it in GitHub Desktop.
Apache rewrite rules to show a maintenance page
# Capistrano-style: if maintenance.html exists, it will be served for any request
# other than style and images. Use status code 503 to tell crawlers to come back later.
ErrorDocument 503 /system/maintenance.html
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ - [redirect=503,last]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment