Skip to content

Instantly share code, notes, and snippets.

@rqreyes
Created January 23, 2016 04:18
Show Gist options
  • Save rqreyes/90171d20883e4041a20b to your computer and use it in GitHub Desktop.
Save rqreyes/90171d20883e4041a20b to your computer and use it in GitHub Desktop.
maintenance page .htaccess
#ADD this block of code to the very top of the htaccess file
#make sure maintenance.html is in the root
#make sure to edit maintenance.html to include client specific information
#remove this code when the site maintenance is completed
# MAINTENANCE-PAGE REDIRECT
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^66\.27\.58\.251
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule .* /maintenance.html [R=302,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment