Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Maintenance page redirection with htaccess
# check if there is a file named maintenance.html
# so when you want to disable maintenance mode just remname "mv maintenance.html maintenance.html.disabled"
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html
<!-- Sample maintenance page -->
<!DOCTYPE html>
<title>Down For Maintenance</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
h1 { font-size: 50px; }
body { text-align:center; font: 20px Helvetica, sans-serif; color: #333; }
<h1>Down For Maintenance</h1>
<p>Sorry for the inconvenience, but we’re performing a maintenance at the moment.</p>
<p>We’ll be back online shortly!</p>
Copy link

marlonlamancio commented Feb 10, 2017


Copy link

yosemite-windows commented Aug 18, 2018

perfect solution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment