cancel
Showing results for 
Search instead for 
Did you mean: 

Blocking specific countries visiting my website

Hi,

 

Would like to ask for help to know how to block all visitors of my website coming from a specific country?

 

Thanks!

 

2 REPLIES 2

Re: Blocking specific countries visiting my website

Hello ericonolasco,

 

So in regards to blocking specific countries you will need to acquire the ip address range using 3rd party sites but for example if I was in another country and wanted to block the united states I could use code like this:

This code was generated using a 3rd party site (https://www.countryipblocks.net)

 

Once you have the code generated you can place it within your .htaccess file, I have included a link to more info regarding that if you are not familiar.

(https://www.godaddy.com/help/what-is-htaccess-2504)

 

(ip address range in example is not complete due to character restrictions and does not work)

<Limit GET POST>
deny from 1.1.1.1.0
allow from all
</Limit>

 

Mike L. | WebPro

Re: Blocking specific countries visiting my website

Thanks a lot, Michael. 

 

Big help on how I can setup blocking specific countries accessing my site.

 

Erico