Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iammart/443486 to your computer and use it in GitHub Desktop.
Save iammart/443486 to your computer and use it in GitHub Desktop.
Redirect all but 1 IP to different site, using mod_rewrite
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^00\.00\.00\.00
RewriteRule .* http://www.google.com [R=302,L]
@iammart
Copy link
Author

iammart commented Jun 29, 2010

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^00.00.00.00 // Redirect to new domain, keeping the file/dir path
RewriteRule ^(.*)$ http://www.google.com/$1 [R=302,L]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment