Static HTML for "Under Maintenance"
HTML
The following html can be used as a "site maintenance" message. On Drupal, WordPress, and Joomla sites (or any other site with index.php), rename the index.php file to a backup such as index.php.live, and then copy the following html into a new file named index.html.
<!doctype html>
<title>Site Maintenance</title>
<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; max-width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
<article>
<h1>We’ll be back soon!</h1>
<div>
<p>Sorry for the inconvenience but we’re performing some maintenance at the moment. We’ll be back online shortly!</p>
</div>
</article>
.htaccess
Under "maintenance mode", it's desirable to have all urls (e.g. /wp-admin) redirect to the bare domain, so that
admin URLs also display the static "maintenance" html page without additional url-specific configuration.
The following .htaccess file can be used for this. In the docuemnt root, rename .htaccess to a backup such as .htaccess.live,
and then copy the following into a new file named .htaccess
RewriteEngine On
# OPTIONAL:
# Strip leading www
# (Comment this out if the site is normally served under 'www'.
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1/ [R=302,L]
# Force HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}/ [R=302,L]
# Discard all paths (force bare root)
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^ / [R=302,L]