How to Block RIPE IP Addresses With .htaccess

Just in case you ever wondered who you should block off and keep almost 100% of your site free from spammers and scrapers, I’ve found it’s always a good idea to block off the RIPE network. Not that it’s all a bad thing, or that you don’t get legitimate traffic from there, it’s just that a full 100% of the traffic I got from there was spammish.

Before we get started, some things to remember. Like last time, if you have no idea what I’m talking about, let the person who you bug about all things electronic do it for you. Also, this tutorial needs a modern Apache webserver. Most importantly, if you expect legitimate readers from the Asia Pacific region of the world, you could block your readers. Remember these things.

Copy and paste this into your .htaccess file:

#Amsterdam
deny from 62.
deny from 80.
deny from 81.
deny from 82.
deny from 83.
deny from 84.
deny from 85.
deny from 86.
deny from 87.
deny from 88.
deny from 89.
deny from 90.
deny from 91.
deny from 139.10.
deny from 139.12.
deny from 139.16.
deny from 139.18.
deny from 139.24.
deny from 139.28.
deny from 139.30.
deny from 147.83.
deny from 147.84.
deny from 147.91.
deny from 193.
deny from 194.
deny from 195.
deny from 212.
deny from 213.
deny from 217.
#Australia
deny from 58.
deny from 59.
deny from 60.
deny from 61.
deny from 165.228.
deny from 165.229.
deny from 168.140.
deny from 202.
deny from 203.
deny from 210.
deny from 211.
deny from 218.
deny from 219.
deny from 220.
deny from 221.
deny from 222.

That would be it.

The Amsterdam and Australia mean really nothing. They are just there to keep things organized. Doing a whois on the IP ranges shows to which branch of RIPE they belong. You can shuffle them all together into one neat list, if you like.

Like I wrote before, this is a throw-the-baby-out-with-the-bath-water approach to banning. The way I have it set up, you block everything in the IP range rather mercilessly. The only reasonable purpose for doing this would be if you are losing a lot of bandwidth to non–human traffic.

Post a comment