Skip to content

Instantly share code, notes, and snippets.

@wernersmit
Last active March 7, 2018 13:52
Show Gist options
  • Select an option

  • Save wernersmit/22ca97297a92a3173ae1cdf373d22780 to your computer and use it in GitHub Desktop.

Select an option

Save wernersmit/22ca97297a92a3173ae1cdf373d22780 to your computer and use it in GitHub Desktop.
Custom maintenance page with 503 status and html page
# TEMP MAINTENANCE PAGE
<IfModule mod_rewrite.c>
RewriteEngine On
# maintenance page and assets
RewriteCond %{REQUEST_URI} !/maintenance [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
# serve default 503 response
RewriteRule .* ./maintenance.html [R=503,L]
# alternate response without custom page
# RewriteRule .* - [R=503,L]
</IfModule>
# serve custom 503 response
ErrorDocument 503 /maintenance.html
<html>
<head>
<title>Temporarily unavailable</title>
</head>
<body>
<h1>Temporarily unavailable</h1>
<p>Please check back soon.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment