Skip to content

Instantly share code, notes, and snippets.

@johnschrom
Created February 1, 2013 17:43
Show Gist options
  • 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