Skip to content

Instantly share code, notes, and snippets.

@trepichio
Last active October 13, 2021 22:33
Show Gist options
  • Save trepichio/935173f94618be7c35e5b8030ad6a00f to your computer and use it in GitHub Desktop.
Save trepichio/935173f94618be7c35e5b8030ad6a00f to your computer and use it in GitHub Desktop.
Maintenance page
# MAINTENANCE-PAGE REDIRECT
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule .* /maintenance.html [R=302,L]
</IfModule>
<!DOCTYPE html>
<html>
<head>
<title>Site Maintenance</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body {
text-align: center;
padding: 150px;
}
h1 {
font-size: 50px;
}
body {
font: 20px Helvetica, sans-serif;
color: #333;
}
article {
display: block;
text-align: left;
width: 650px;
margin: 0 auto;
}
a {
color: #dc8100;
text-decoration: none;
}
a:hover {
color: #333;
text-decoration: none;
}
</style>
</head>
<body>
<article>
<h1>We&rsquo;ll be back soon!</h1>
<div>
<p>
Sorry for the inconvenience but we&rsquo;re performing some
maintenance at the moment. If you need to you can always
<a href="mailto:#">contact us</a>, otherwise we&rsquo;ll be back
online shortly!
</p>
<p>&mdash; The Team</p>
</div>
</article>
</body>
</html>
# Forward requests to maintenace site
[[redirects]]
from = "/*"
to = "/maintenance.html"
status = 200
force = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment