To prevent the entry of different users from the specific country you want, there are solutions in Direct Admin. Sifting your audience to avoid any conflicts or complications is essential to maintaining a fully functional website. As a DirectAdmin user, you can block a country's traffic on your hosting. Join us to do this.

To block the traffic of the country

1. Log in to your direct admin account.

2. htaccess file. Edit through the File Manager section.

3. Enter this line at the end of the file:

<IfModule mod_geoip.c> RewriteEngine on RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$ RewriteRule ^(.*)$ – [F,L] </IfModule>

 

محدود کردن ترافیک یک کشور در دایرکت ادمین

 

Click to buy high-speed and powerful Radib hosting

 


The above line will restrict users from the United States of America from accessing your site, and the country code for the United States of America is US.

You can refer to this ISO 3166-1 alpha-2 link to find the country codes you are looking for.

4. Finally, click on the Save button.

Was this answer helpful? 101 Users Found This Useful (101 Votes)