Blocking an IP range without using .htaccess
Posted
by Chris
on Server Fault
See other posts from Server Fault
or by Chris
Published on 2010-03-17T15:59:25Z
Indexed on
2010/03/17
16:01 UTC
Read the original article
Hit count: 616
I have a WordPress blog that I am hosting using NearlyFreeSpeech.net. Recently, Russians found it and have been comment spamming me. I don't want to have to trash 30+ Cyrillic comments/day, and I don't want to pay for that bandwidth either.
I did a little research, and all the commentors are originating from RIPE delegated IP ranges. Because my blog can only interest people living in the American Southeast, I figured the quick and dirty solution would be to use .htaccess to deny connections coming from 62.0.0.0/8 and 80.0.0.0/8 - 91.0.0.0/8. I wrote a .htaccess file that did just this, but the Russians were still getting through!
According to NearlyFreeSpeech.net's FAQ, they can't support IP blocking through .htaccess (dirt cheap hosting comes with a price). I can block comments by IP through Wordpress (I think), but I can't figure out a way to block IP ranges or wildcards.
Does anybody know of any other way?
© Server Fault or respective owner