Blocking IP range not working

Hi,

I have the following code in my .htaccess file for blocking an IP range:

Order Deny,Allow
Deny from ^178.137

The purpose is to block any IP that starts with 178.137

However, I still get hits from IPs within this block. Is my code correct? If it is, I will contact hosting support as there may be an upper-level rule overriding my rule.

Thanks for any ideas.

I think that should be

deny from 178.137.0.0/16

or

deny from 178.137.*.*

See https://perishablepress.com/stupid-htaccess-tricks/#sec7a for more details.

2 Likes

Thanks, I’ll try that one now.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.