There are times when you may want to ban visitors from a certain country from viewing your website, the reasons for this can be many.
You can block people from viewing your website using rules in your firewall IP tables but if you dont have access to that, you can edit the .htaccess file and add a list of IPs to be blocked, you can get the whole IP range from a country from Blockacountry.
However this solution may cause server overload if many requests are made from that country, another easier way to do this, is by banning people from accessing your website according to their browser language set up, for example to ban people who is using a Chinese internet browser you will add to your .htaccess file:
RewriteCond %{HTTP_ACCEPT_LANGUAGE} zh-CN
RewriteRule .* – [F]
THis will generate error 403 message, and the visitor will get a “Forbidden” message when visiting your page, but it can be changed to something else. The zh-CN is the browser setting for Chinese, this can be changed to any other language you like.

