Forum Moderators: open
Also, is their a way to ban a IP range without listing each one? For example, if I wanted to ban "192.1.1" through "192.1.255" in htaccess, is their a shorthand way to do this?
My error log constantly fills up with addresses starting with "218." or the APNIC IP's. So I just banned "218." in htaccess. Should I go more specific and only ban ranges of trouble places?
It depends if you feel (as the webmaster) that you stand to gain visitors and traffic from the other 218 ranges?
Also, is their a way to ban a IP range without listing each one? For example, if I wanted to ban "192.1.1" through "192.1.255" in htaccess, is their a shorthand way to do this?
This may help?
[webmasterworld.com...]
You may deny IP ranges to individual Class'es (A, B, or C)
wiith either
deny from 192.1. keep_out [or whatever term you use]
or
RewriteCond %{REMOTE_ADDR} ^192\.1\. [note if you have multiple lines this will likley require an "[OR]" flag]
In both of the above instances the 192.1.0-255.0-255 are denied.
Also, is their a way to ban a IP range without listing each one? For example, if I wanted to ban "192.1.1" through "192.1.255" in htaccess, is their a shorthand way to do this?
I apologize, I meant "192.1.50" through "192.1.80"
without listing them like,
deny from 192.1.50
deny from 192.1.51
deny from 192.1.52
...
*EDIT* nevermind, I see it in your link
To convert IP ranges to CIDR, you may use a tool like IPRange2CIDR ( [kgsoft.com...] )