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 :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
No comments:
Post a Comment