Maintaining a List on Your Server

There are several sites with free lists of IPs for specific countries, ready to download.

Once you have a list, you can block the IPs in htaccess or httpd.conf. In my view, this is a cumbersome way of blocking visitors from certain countries, because IPs change all the time. Do you want to update your IP country table all the time?

If you did want to use this method, you might add lines like these to your .htaccess:

Order allow,deny
Allow from all
Deny from 58.14.0.0/15
Deny from 58.16.0.0/16
… etc. (huge list of IP addresses or ranges