Use .htaccess to block a range of IP
Question:
I am having troubles with serverpronto bots attacking my site in droves.
How would I block this range of ip address in .htaccess using deny:
69.60.114.0 – 69.60.125.255
for example, to block one ip I would have:
Deny from 64.251.14.99But how would I block the whole range given?
Thank you in advance
jdMorgan
Answer:
Denying 69.60.114.0 – 69.60.125.255
Any of the following:
Deny from 64.251.114
Deny from 64.251.115
Deny from 64.251.116
Deny from 64.251.117
Deny from 64.251.118
Deny from 64.251.119
Deny from 64.251.120
Deny from 64.251.121
Deny from 64.251.122
Deny from 64.251.123
Deny from 64.251.124
Deny from 64.251.125
-or-
# Deny 69.60.114.0 – 69.60.115.255 (512 addresses)
Deny from 69.60.114.0/23
# Deny 69.60.116.0 – 69.60.119.255 (1024 addresses)
Deny from 69.60.116.0/22
# Deny 69.60.120.0 – 69.60.123.255 (1024 addresses)
Deny From 69.60.120.0/22
# Deny 69.60.124.0 – 69.60.125.255 (512 addresses)
Deny from 69.60.124.0/23
-or-
# Deny 69.60.114.0 – 69.60.115.255 (512 addresses)
Deny from 69.60.114.0/255.255.254.0
# Deny 69.60.116.0 – 69.60.119.255 (1024 addresses)
Deny from 69.60.116.0/255.255.252.0
# Deny 69.60.120.0 – 69.60.123.255 (1024 addresses)
Deny From 69.60.120.0/255.255.252.0
# Deny 69.60.124.0 – 69.60.125.255 (512 addresses)
Deny from 69.60.124.0/255.255.254.0
-or-
Setenvif Remote-Addr “^69\.60\.1(1[4-9]¦2[0-5])\.” getout
Deny from getout
Posted on March 21st, 2009 by Denie
Filed under: Apache, Tutorials




















































Leave a Reply