Innovate | Connect | Transform
ContactService statusUSD $

GICT knowledge base

How to block country in DirectAdmin hosting

Published

geo accessDirectAdmin

1) log in to the DirectAdmin Control Panel.

DA1

2) Got to file manager >> locate .htaccess file (/home/domainname/public_html/.htaccess)

DA1

DA3

3. Now right click on the .htaccess file and select Edit in the new tab. And then add the below-given code, click on the Save file icon.

DA4

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

Country code is used as “US”.  This means the website can be only accessed from the US.  Anyone accessing the website apart from the US will get a Forbidden error.

4. Result.

DA5

If you have got any questions please feel free to contact us. Will be happy to help you.
Account services are unavailable until the production backend is configured.