Skip to content

Instantly share code, notes, and snippets.

@manfromanotherland
Created March 10, 2015 12:05
Show Gist options
  • Save manfromanotherland/7fb17f7dec1dc65ab8a9 to your computer and use it in GitHub Desktop.
Save manfromanotherland/7fb17f7dec1dc65ab8a9 to your computer and use it in GitHub Desktop.
.htaccess: Temporary redirect to /dir with IP rule #snippet
# ----------------------------------------------------------------------
# TEMP REDIRECT TO /DIR
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.1
RewriteCond %{REQUEST_URI} !/DIR$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule .* /DIR [R=302,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment