Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active November 14, 2019 09:49
Show Gist options
  • Save zulhfreelancer/224eb764de53813a3b341bd90d12fbae to your computer and use it in GitHub Desktop.
Save zulhfreelancer/224eb764de53813a3b341bd90d12fbae to your computer and use it in GitHub Desktop.
WordPress maintenance mode for Apache server
RewriteEngine On
RewriteBase /
# everyone will see the Maintenance Page except people with IP below
RewriteCond %{REMOTE_ADDR} !^xx\.x\.xx\.xxx$
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ /maintenance.html [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
<title>Service Temporarily Unavailable</title>
<style>
body {
margin-top: 1rem;
}
</style>
</head>
<body class="container">
<div class="row">
<div class="col-md-12">
<h4>Service Temporarily Unavailable</h4>
<p>The site is currently being updated. Please try again later.</p>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment