Using .htaccess to block tor servers

.htaccessapache-2.2

I have a large list of tor servers, maybe 2,000+ servers that I would like to ban from registering accounts on my site. Is it viable to block the entire list I have in an .htaccess file or will this cause the server to slow down in the same way having thousands of hosts in iptables will?

Is there another alternative? I have captcha already but bots aren't the problem. The problem is users using tor to circumvent bans.

Best Answer

You can use your htaccess file

order deny,allow
deny from x.x.x.x
deny from x.x.x.
allow from all

The alterative (and probably best) way is adding a DROP rule in your iptables firewall, which will keep the IP addressess away from your server.