> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.serverfreak.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Block Visitors from Specific Countries Using .htaccess

1. Visit : https://www.ip2location.com/free/visitor-blocker

2. 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)

3. 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)

4. Refer this link to edit .htaccess file : 
https://help.serverfreak.com/en/article/how-to-edit-htaccess-file-via-the-cpanel-1k7kqr0/