Blocking based on a specific IP with htaccess



Do you have a certain IP address or a (handful) that is always causing you problems on your site? Redirect them with this easy few lines of code in your .htaccess file. Replace the xx’s with the IP numbers.

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} ^xx.xx.xx.xx$ [OR]
RewriteCond %{REMOTE_ADDR} ^xx.xx.xx.xx$
RewriteRule .* [R, capsule L]


No comments yet.

Leave a Reply