{"id":14859,"date":"2021-11-23T12:41:09","date_gmt":"2021-11-23T12:41:09","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=14859"},"modified":"2022-02-15T15:55:16","modified_gmt":"2022-02-15T10:25:16","slug":"block-country-traffic-directadmin","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/","title":{"rendered":"How to Block Country Traffic in DirectAdmin?"},"content":{"rendered":"<p>Screening your audience to avoid any conflicts or complications becomes necessary to maintain a perfectly working website. As a DirectAdmin&nbsp;user, you can block the web traffic of a country on your&nbsp;hosting.<\/p>\n<h2>To Block Country Traffic<\/h2>\n<p>1. Log in to your <em>DirectAdmin<\/em> account.<\/p>\n<p>2. Edit the&nbsp;<em>.htaccess<\/em> file via the <strong>File Manager<\/strong> tool.<\/p>\n<p>Refer this article to know <a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/create-edit-htaccess-file-directadmin\/\">How to Create\/Edit .htaccess File via DirectAdmin?<\/a><\/p>\n<p>3. Enter this line at the end of the file:<\/p>\n<pre class=\"lang:default decode:true\">&lt;IfModule mod_geoip.c&gt; RewriteEngine on RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$ RewriteRule ^(.*)$ \u2013 [F,L] &lt;\/IfModule&gt;<\/pre>\n<p>The given line has used the&nbsp;<strong>US<\/strong>, which is the country code for the United States of America. It will<\/p>\n<p>You can refer to this link&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1_alpha-2#JO\" target=\"_blank\" rel=\"nofollow noopener\">ISO 3166-1 alpha-2<\/a> to find the country codes you are looking for.<\/p>\n<p>4. Click <strong>Save<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14860\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png\" alt=\"\" width=\"1864\" height=\"846\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png 1864w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic-300x136.png 300w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic-768x349.png 768w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic-1024x465.png 1024w\" sizes=\"auto, (max-width: 1864px) 100vw, 1864px\" \/>With it, the country traffic you choose to block will be screened by DirectAdmin. It means the server will reject any access request from the country you blocked.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Screening your audience to avoid any conflicts or complications becomes necessary to maintain a perfectly working website. As a DirectAdmin&nbsp;user, you can block the web traffic of a country on your&nbsp;hosting. To Block Country Traffic 1. Log in to your DirectAdmin account. 2. Edit the&nbsp;.htaccess file via the File Manager tool. Refer this article to [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1798,41],"tags":[2746,2745,2523,2578,539],"class_list":["post-14859","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-directadmin","category-howtos","tag-block-country-traffic","tag-block-country-traffic-directadmin","tag-block-traffic","tag-directadmin-hosting","tag-website-traffic"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Block Country Traffic in DirectAdmin - Web Hosting FAQs by MilesWeb<\/title>\n<meta name=\"description\" content=\"You can screen and block web traffic from a specific country by editing the htaccess file using the File Manager in DirectAdmin.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Block Country Traffic in DirectAdmin - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"You can screen and block web traffic from a specific country by editing the htaccess file using the File Manager in DirectAdmin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-23T12:41:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-15T10:25:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png\" \/>\n<meta name=\"author\" content=\"Prasad Khartadkar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasad Khartadkar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/\"},\"author\":{\"name\":\"Prasad Khartadkar\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/#\\\/schema\\\/person\\\/c9138a9488172a8d0aa2d4f40878d83e\"},\"headline\":\"How to Block Country Traffic in DirectAdmin?\",\"datePublished\":\"2021-11-23T12:41:09+00:00\",\"dateModified\":\"2022-02-15T10:25:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/\"},\"wordCount\":155,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/da_htaccess_block_country_traffic.png\",\"keywords\":[\"Block Country Traffic\",\"Block Country Traffic DirectAdmin\",\"block traffic\",\"directadmin hosting\",\"website traffic\"],\"articleSection\":[\"DirectAdmin\",\"How-Tos\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/\",\"url\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/\",\"name\":\"Block Country Traffic in DirectAdmin - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/da_htaccess_block_country_traffic.png\",\"datePublished\":\"2021-11-23T12:41:09+00:00\",\"dateModified\":\"2022-02-15T10:25:16+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/#\\\/schema\\\/person\\\/c9138a9488172a8d0aa2d4f40878d83e\"},\"description\":\"You can screen and block web traffic from a specific country by editing the htaccess file using the File Manager in DirectAdmin.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/da_htaccess_block_country_traffic.png\",\"contentUrl\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/da_htaccess_block_country_traffic.png\",\"width\":1864,\"height\":846},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/block-country-traffic-directadmin\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Block Country Traffic in DirectAdmin?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/#website\",\"url\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/#\\\/schema\\\/person\\\/c9138a9488172a8d0aa2d4f40878d83e\",\"name\":\"Prasad Khartadkar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Prasad-K.-1-150x150.jpg\",\"url\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Prasad-K.-1-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Prasad-K.-1-150x150.jpg\",\"caption\":\"Prasad Khartadkar\"},\"description\":\"Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.\",\"sameAs\":[\"https:\\\/\\\/www.milesweb.in\"],\"url\":\"https:\\\/\\\/www.milesweb.in\\\/hosting-faqs\\\/author\\\/prasad-khartadkar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Block Country Traffic in DirectAdmin - Web Hosting FAQs by MilesWeb","description":"You can screen and block web traffic from a specific country by editing the htaccess file using the File Manager in DirectAdmin.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/","og_locale":"en_US","og_type":"article","og_title":"Block Country Traffic in DirectAdmin - Web Hosting FAQs by MilesWeb","og_description":"You can screen and block web traffic from a specific country by editing the htaccess file using the File Manager in DirectAdmin.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2021-11-23T12:41:09+00:00","article_modified_time":"2022-02-15T10:25:16+00:00","og_image":[{"url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png","type":"","width":"","height":""}],"author":"Prasad Khartadkar","twitter_misc":{"Written by":"Prasad Khartadkar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/"},"author":{"name":"Prasad Khartadkar","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e"},"headline":"How to Block Country Traffic in DirectAdmin?","datePublished":"2021-11-23T12:41:09+00:00","dateModified":"2022-02-15T10:25:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/"},"wordCount":155,"commentCount":0,"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png","keywords":["Block Country Traffic","Block Country Traffic DirectAdmin","block traffic","directadmin hosting","website traffic"],"articleSection":["DirectAdmin","How-Tos"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/","name":"Block Country Traffic in DirectAdmin - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png","datePublished":"2021-11-23T12:41:09+00:00","dateModified":"2022-02-15T10:25:16+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e"},"description":"You can screen and block web traffic from a specific country by editing the htaccess file using the File Manager in DirectAdmin.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#primaryimage","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/11\/da_htaccess_block_country_traffic.png","width":1864,"height":846},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/block-country-traffic-directadmin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Block Country Traffic in DirectAdmin?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e","name":"Prasad Khartadkar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg","caption":"Prasad Khartadkar"},"description":"Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/prasad-khartadkar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=14859"}],"version-history":[{"count":2,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14859\/revisions"}],"predecessor-version":[{"id":15839,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14859\/revisions\/15839"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=14859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=14859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=14859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}