Created
August 3, 2014 14:38
-
-
Save stefanzweifel/7ce9076de8125d01874d to your computer and use it in GitHub Desktop.
Restrict all traffic except your IP address and more with .htaccess
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 | |
# If the IP address does not match this one | |
RewriteCond %{REMOTE_ADDR} !^110.110\.110\.110$ | |
# And they are not accessing a certain subdirectory | |
RewriteCond %{REQUEST_URI} !^/admin | |
# And they are not accessing the development domain | |
RewriteCond %{HTTP_HOST} !^development\.example\.com$ | |
# Redirect them to a temporary site | |
RewriteRule ^(.*)$ http://www.construction.com [R=302,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment