Monday, April 7, 2014

Maintenance page redirection with htaccess

RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html 


When you want to disable maintenance mode just remname maintenance file to something else

mv maintenance.html maintenance.html.disabled"

Gist with sample maintenance page :

No comments: