Skip to content

Instantly share code, notes, and snippets.

@johnschrom
Created February 1, 2013 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnschrom/4692841 to your computer and use it in GitHub Desktop.
Save johnschrom/4692841 to your computer and use it in GitHub Desktop.
Sometimes you want to block certain IP addresses from accessing your website. Add this snippet to your .htaccess, change "IP-ADDRESS" to be their IP address, and they'll get forwarded to your specified URL.
RewriteCond %{REMOTE_HOST} IP-ADDRESS
RewriteRule .* "http://www.google.com" [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment