Skip to content

Instantly share code, notes, and snippets.

@offmessage
Created December 21, 2011 18:00
Show Gist options
  • Save offmessage/1507002 to your computer and use it in GitHub Desktop.
Save offmessage/1507002 to your computer and use it in GitHub Desktop.
An apache config for a maintenance page
<VirtualHost *:80>
ServerName www.yoursite.com
ServerAdmin hosting@yourdomain.com
DocumentRoot /var/local/sites/www.yoursite.com/emergency
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{ENV:REDIRECT_STATUS} !=503
RewriteRule ^ - [L,R=503]
# Make sure index.html doesn't exist
ErrorDocument 503 /emergency.html
CustomLog /var/log/apache2/emergency-www.yoursite.com-access.log combined
ErrorLog /var/log/apache2/emergency-www.yoursite.com-error.log
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment