Skip to content

Instantly share code, notes, and snippets.

Embed
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>
<html>
<head>
<title>Down For Maintenance</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
h1 { font-size: 50px; }
body { text-align:center; font: 20px Helvetica, sans-serif; color: #333; }
</style>
</head>
<body>
<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>
</body>
</html>
@marlonlamancio

This comment has been minimized.

Copy link

marlonlamancio commented Feb 10, 2017

thanks

@yosemite-windows

This comment has been minimized.

Copy link

yosemite-windows commented Aug 18, 2018

perfect solution !
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.