GICT knowledge base
How to block country in DirectAdmin hosting
Published
1) log in to the DirectAdmin Control Panel.

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


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.

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

If you have got any questions please feel free to contact us. Will be happy to help you.
Related guides
Host Additional Domains on an Eligible GICTServer Account
Check your hosting limits, choose a separate site or alias and use cPanel or DirectAdmin with deliberate DNS, content and certificate verification.
DirectAdminDirectadmin Legacy Downgrade errors
Understanding the DirectAdmin "Legacy Downgrade" Error If you are managing a server with DirectAdmin and suddenly find your control panel inaccessible, you may be facing...
DirectAdminDirectAdmin Storage Bandwidth Calculation
Understanding DirectAdmin Bandwidth and Storage Limits DirectAdmin storage manages specific bandwidth and disk space limits for your account.
DirectAdminDirectadmin Legacy Licenses
The State of DirectAdmin Licenses: Legacy vs. Unified In the past directadmin offered two code bases: Standard and Propack with additional features.
