If you’re running a server and would like to prevent a particular country, that’s right a country, from accessing the server, visit this site for help configuring your .htaccess file.
You might find that you’re getting a lot of spam or malicious traffic from a spam-heavy country and find it easier to block the entire nation than fighting to keep up with the never-ending battle. You might also be concerned about export limitations to particular nations and block the country to keep their traffic out (unless they use a proxy). Simply go to BlockACountry.com and select the countries you want to block (hold down shift to select a group of countries or hold down Ctrl to individual pick out the countries). Hit the ‘Go’ button and your .htaccess file will be generated.
The resulting page will give you a text box that you can copy+paste into your current .htaccess file or a link to download a htaccess.txt file. If you choose the latter option, just rename that file on your server to .htaccess