Last active
March 28, 2017 07:06
-
-
Save bmunslow/a032080627e0230cfd8c to your computer and use it in GitHub Desktop.
Custom .htaccess maintenance mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# Customize specific IP address which should have access to the live site | |
RewriteCond %{REMOTE_ADDR} !^11\.22\.33\.44 | |
# Customize name of your maintenance mode template file | |
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC] | |
# Only images and CSS files are allowed. Customize to allow Javascript or other image extensions | |
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|css) [NC] | |
# Customize name of your maintenance mode template file | |
RewriteRule .* /maintenance.html [R=302,L,E=nocache:1] | |
# Set the response header if the "nocache" environment variable is set in the RewriteRule above. | |
Header always set Cache-Control "no-store, no-cache, must-revalidate" env=nocache | |
Header always set Expires "Thu, 01 Jan 1970 00:00:00 GMT" env=nocache | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment