Skip to content

Instantly share code, notes, and snippets.

@leobossmann
Created September 12, 2013 10:37
Show Gist options
  • Save leobossmann/6535575 to your computer and use it in GitHub Desktop.
Save leobossmann/6535575 to your computer and use it in GitHub Desktop.
.htaccess-rule to redirect if request is not from the defined IP
RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.com$
RewriteCond %{REMOTE_HOST} !^123\.234\.345\.456$
RewriteRule ^(.*)$ http://www.domain2.com/$1 [L,R=302]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment