Home > OS >  How to lock unwanted IPs in the .htaccess?
How to lock unwanted IPs in the .htaccess?

Time:06-26

In most cases, the .htacess seems to lock out unwanted visitors from my site. But some bad boys are able to penetrate my .htacess protection. Example: The bad boy is has the IP 46.161.11.xx . So I wrote into the .htaccess file:

Require not ip 46.161.11.

But this did not help. So I changed it to:

RewriteCond %{REMOTE_ADDR} ^46\.161\.11\.([1-9]?\d|[12]\d\d)$ [NC]
RewriteRule ^.* - [F,L]

But this does not help, too.

Is there a more effective IP lock in Apache? Thx in advance for your hints.

CodePudding user response:

This seems to be my solution:

    RewriteCond %{REMOTE_HOST} 46\.161\.11\.
    RewriteRule .* - [F,L]
  • Related