/gist:8fe0308ed12cca1816a4ba3fb88da255
Forked from anonymous/gist:c3066c657c453c09a48deb1ed8b5d12f
Created Mar 5, 2018
.htacess/httpd.conf maintenance mode changes
RewriteEngine On | |
# If this file (toggle file) exsists then put the site into maintenance mode | |
RewriteCond /path/to/where/your/toggle/file/is/located/on/the/server -f | |
# If coming from approved ip address, then don't put it into maintenance mode, | |
# here I'm using HTTP:x-forwarded-for in place of REMOTE_ADDR this is because some users (or your yourself) might | |
# arrive to the site via a proxy server, so it's more accurate to use HTTP:x-forwarded-for to get the real ip address, | |
# Also please note that the ip address below has '\' in them because HTTP:x-forwarded-for returns or stores the ip address as a comma delimited list | |
RewriteCond %{HTTP:x-forwarded-for} !^127\.127\.127\.127$ | |
# redirect to the maintenance mode page | |
RewriteRule ^(.+) /path/to/the/maintenance/mode/directory/or/index.html/$1 [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment