How to Block Visitors from Specific Countries Using .htaccess
Visit : https://www.ip2location.com/free/visitor-blocker
To generate the block list, select IPv4, select the country (if you require more than 1, you’ll need to sign up for a free account that allows up to 30 countries) and choose Apache 2.0-2.3 .htaccess deny from the drop down menu and click DOWNLOAD
![](https://storage.crisp.chat/users/helpdesk/website/30c43b4318b81000/image_otkrc1.png)
You will get to download a text file which is to be uploaded to your homepage’s directory as .htaccess. Copy and paste in the file .htaccess in your hosting
![](https://storage.crisp.chat/users/helpdesk/website/30c43b4318b81000/image_4yh72d.png)
Refer this link to edit .htaccess file :
https://help.serverfreak.com/en/article/how-to-edit-htaccess-file-via-the-cpanel-1k7kqr0/
To generate the block list, select IPv4, select the country (if you require more than 1, you’ll need to sign up for a free account that allows up to 30 countries) and choose Apache 2.0-2.3 .htaccess deny from the drop down menu and click DOWNLOAD
![](https://storage.crisp.chat/users/helpdesk/website/30c43b4318b81000/image_otkrc1.png)
You will get to download a text file which is to be uploaded to your homepage’s directory as .htaccess. Copy and paste in the file .htaccess in your hosting
![](https://storage.crisp.chat/users/helpdesk/website/30c43b4318b81000/image_4yh72d.png)
Refer this link to edit .htaccess file :
https://help.serverfreak.com/en/article/how-to-edit-htaccess-file-via-the-cpanel-1k7kqr0/
Updated on: 07/01/2023
Thank you!