How to block access to our website in some countries

block website to some countries

If you have a blog or a website and you want block access to your information to a certain number of users In different parts of the planet, you can achieve this as long as you are a web developer and you know certain applications and online tools.

Unfortunately not everyone has this type of knowledge, and therefore must try to use simple tools that are easy to understand. That will be the objective of this article, because here we will mention certain resources that you can use to block access to your website, to different parts of the planet.

Why block access to a website in certain regions?

There may be many reasons why you could be trying to perform this type of task, although for the moment we are going to suggest a slight example that could be considered "generalized"; there are users or administrators of a website, who could be organizing a contest for all visitors, even that could contemplate a gift (a physical gift) that must be delivered only in a local region. For this reason, you would have to direct the contest only for visitors who live in the same country because to another place, it would be very difficult for you to deliver what was offered.

IP2Location

«IP2Location»Is the first alternative that we will mention at this time, which is an online tool that will help you obtain a list of IP addresses, which you will later have to use to integrate into the .htaccess file.

ip2location-deny-database

The image that we have placed at the top will serve as an example of what you have to do; if you go select a country to block or allow access towards your website, you do not need to make any kind of registration. If you need to use several countries then you will have to make a free subscription of your data. The parameter that becomes the key to everything is in the final part, because there you have to choose between:

  1. Apache .htaccess Allow
  2. Apache .htaccess deny

At the end you will have to select the button that says "download" to download the list that you will have to integrate into your website and in the .htaccess file using an ftp client.

Country IP Blocks

"Country IP Blocks" is also an online tool that has similar functions to the previous proposal, although here you will have a few additional options that can be used by web developers with advanced knowledge.

country-ip-blocks

As before, here you also have the possibility to choose the countries you want to "block or allow" to access information on your website; At the bottom of the list of these countries are these options and a few more that must be selected, through their respective box. At the end you only have to select the button that says "Create ACL" to obtain the information that you will have to later integrate into the .htaccess file of your website.

BlockACountry.com

This tool has a much friendlier interface than the alternatives we mentioned above. Here you just have to write the domain name of your website and then choose the countries you want to block access to its content.

blockacountry

This online service is present as a kind of assistant, which you must follow until you obtain the file that you will later have to integrate into the .htaccess of your website.

Software77 IP to Country Database

If for some reason you can't handle the alternatives we mentioned above, then we recommend trying to work with a built-in function in «Software77«, Which you will find in its right sidebar.

software77-ip2country

There you just have to choose the country you want to block access to the information of your website, then to the option that says "CIDR" and finally to "Submit". With all these tools that we have mentioned, you can very easily block different regions on the planet so that they do not have access to the content of your website. Of course there are other additional alternatives that we could be using, which will depend on the platform on which your website is built. For example, if you use WordPress you could use a specialized plugin (as IP Blocker Country) that will help you perform this task, in an easier way than any of the alternatives that we have mentioned on this occasion.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.