Last active
April 19, 2020 19:20
-
-
Save hasantayyar/10018548 to your computer and use it in GitHub Desktop.
Maintenance page redirection with htaccess
This file contains hidden or 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 hidden or 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> |
perfect solution !
thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks