file - working - htaccess restrict access by domain




How to Block an IP address range using the.htaccess file (4)

I have detected that a range of IP addresses may be used in a malicious way and I don't know how to block it.

I would like to block the range 66.249.74.* from accessing my website by using the .htaccess file.


I’ve just used

Order Allow,Deny
Deny from 188.143.*.*
Allow from all

as spam attack comes from xxx.xxx.0-80.0-80.


Use just the first 3 octets

Order Allow,Deny
Deny from 66.249.74.
Allow from all

You could use:

Order Allow,Deny
Deny from 66.249.74.0/24
Allow from all

Or you could use this:

RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^66\.249\.74\.
RewriteRule ^ - [F]







rank