{"id":23025,"date":"2018-10-31T09:39:37","date_gmt":"2018-10-31T07:39:37","guid":{"rendered":"https:\/\/hetzner.co.za\/help-centre\/?p=23025"},"modified":"2026-05-06T13:02:52","modified_gmt":"2026-05-06T11:02:52","slug":"block-unwanted-traffic-htaccess","status":"publish","type":"post","link":"https:\/\/xneelo.co.za\/help-centre\/website\/block-unwanted-traffic-htaccess\/","title":{"rendered":"How to block unwanted traffic to your website from specific IPs via konsoleH"},"content":{"rendered":"<p>Malicious or unwanted traffic to your website can be blocked by adding a snippet of code to the <strong>.htaccess file within your site content.<\/strong><\/p>\n<p>It&#8217;s possible to block traffic from <strong>specific IPs<\/strong> or a <strong>range of IPs<\/strong> from visiting your website. Even traffic from entire countries can be blocked.<\/p>\n<p>No coding or experience is required \u2013 just follow the steps below.<\/p>\n<h2>Block IPs using .htaccess<\/h2>\n<p>The <strong>.htaccess file is located in the public_html directory<\/strong> of your website content. If you only want to block access to certain parts of your site, you can create a new .htaccess file and upload it to the relevant subdirectory.<\/p>\n<p>This file can be accessed and edited in various ways, including FTP and SSH. Here we will access it via the <strong>konsoleH File Manager<\/strong>:<\/p>\n<ol>\n<li><strong>Browse<\/strong> to <strong><a href=\"http:\/\/secure.konsoleh.co.za\" target=\"_blank\" rel=\"noopener noreferrer\">konsoleH<\/a><\/strong> and <strong>log in<\/strong>\u00a0<a href=\"https:\/\/xneelo.co.za\/help-centre\/accounts-and-payments\/konsoleh-access-levels\/\" target=\"_blank\" rel=\"noopener noreferrer\">(Admin or Domain level)<\/a><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15443\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide.png\" alt=\"\" width=\"2082\" height=\"689\" srcset=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide.png 2082w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide-300x99.png 300w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide-1024x339.png 1024w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide-768x254.png 768w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide-1536x508.png 1536w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide-2048x678.png 2048w\" sizes=\"auto, (max-width: 2082px) 100vw, 2082px\" \/><\/li>\n<li>If Admin level: Select or search for a domain name in the <b>Hosting Service<\/b><strong>s<\/strong> tab<\/li>\n<li>Click <b>Manage Services<\/b>\u00a0from the left-hand menu<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15127\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2014\/08\/kh-manage-services.png\" alt=\"\" width=\"2020\" height=\"1128\" srcset=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2014\/08\/kh-manage-services.png 2020w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2014\/08\/kh-manage-services-300x168.png 300w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2014\/08\/kh-manage-services-1024x572.png 1024w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2014\/08\/kh-manage-services-768x429.png 768w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2014\/08\/kh-manage-services-1536x858.png 1536w\" sizes=\"auto, (max-width: 2020px) 100vw, 2020px\" \/><\/li>\n<li>Select\u00a0<b>File Manage<\/b><strong>r<\/strong>. The files within the public_html folder are immediately visible \u2013 these are website files and includes the .htacess file that governs your whole site.<\/li>\n<li>Click <strong>.htaccess<\/strong> in your file list, then click Edit from the right-hand menu.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17655\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager.png\" alt=\"\" width=\"2214\" height=\"882\" srcset=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager.png 2214w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-300x120.png 300w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-1024x408.png 1024w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-768x306.png 768w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-1536x612.png 1536w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager-2048x816.png 2048w\" sizes=\"auto, (max-width: 2214px) 100vw, 2214px\" \/><\/li>\n<li>Insert the following code snippet at the top or bottom of any other code that is already in the text file, replacing the sample IPs with those that you want to be blocked.\u00a0 Any number of IPs can be listed. Click <strong>Save changes<\/strong><\/li>\n<\/ol>\n<pre style=\"padding-left: 60px;\">order allow,deny\r\ndeny from 123.456.789.01\r\ndeny from 12.123.456.78\r\ndeny from 234.56.789.123\r\nallow from all<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-23029\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2018\/10\/kh-file_manager-htaccess.png\" alt=\"\" width=\"1000\" height=\"366\" srcset=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2018\/10\/kh-file_manager-htaccess.png 1000w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2018\/10\/kh-file_manager-htaccess-300x110.png 300w, https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2018\/10\/kh-file_manager-htaccess-768x281.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false,"plain":"Malicious or unwanted traffic to your website can be blocked by adding a snippet of code to the <strong>.htaccess file within your site content.<\/strong>\r\n\r\nIt's possible to block traffic from <strong>specific IPs<\/strong> or a <strong>range of IPs<\/strong> from visiting your website. Even traffic from entire countries can be blocked.\r\n\r\nNo coding or experience is required \u2013 just follow the steps below.\r\n<h2>Block IPs using .htaccess<\/h2>\r\nThe <strong>.htaccess file is located in the public_html directory<\/strong> of your website content. If you only want to block access to certain parts of your site, you can create a new .htaccess file and upload it to the relevant subdirectory.\r\n\r\nThis file can be accessed and edited in various ways, including FTP and SSH. Here we will access it via the <strong>konsoleH File Manager<\/strong>:\r\n<ol>\r\n \t<li><strong>Browse<\/strong> to <strong><a href=\"http:\/\/secure.konsoleh.co.za\" target=\"_blank\" rel=\"noopener noreferrer\">konsoleH<\/a><\/strong> and <strong>log in<\/strong>\u00a0<a href=\"https:\/\/xneelo.co.za\/help-centre\/accounts-and-payments\/konsoleh-access-levels\/\" target=\"_blank\" rel=\"noopener noreferrer\">(Admin or Domain level)<\/a><img class=\"alignnone size-full wp-image-15443\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/06\/kh-login-wide.png\" alt=\"\" width=\"2082\" height=\"689\" \/><\/li>\r\n \t<li>If Admin level: Select or search for a domain name in the <b>Hosting Service<\/b><strong>s<\/strong> tab<\/li>\r\n \t<li>Click <b>Manage Services<\/b>\u00a0from the left-hand menu<img class=\"alignnone size-full wp-image-15127\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2014\/08\/kh-manage-services.png\" alt=\"\" width=\"2020\" height=\"1128\" \/><\/li>\r\n \t<li>Select\u00a0<b>File Manage<\/b><strong>r<\/strong>. The files within the public_html folder are immediately visible \u2013 these are website files and includes the .htacess file that governs your whole site.<\/li>\r\n \t<li>Click <strong>.htaccess<\/strong> in your file list, then click Edit from the right-hand menu.<img class=\"alignnone size-full wp-image-17655\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2016\/12\/kh-file-manager.png\" alt=\"\" width=\"2214\" height=\"882\" \/><\/li>\r\n \t<li>Insert the following code snippet at the top or bottom of any other code that is already in the text file, replacing the sample IPs with those that you want to be blocked.\u00a0 Any number of IPs can be listed. Click <strong>Save changes<\/strong><\/li>\r\n<\/ol>\r\n<pre >order allow,deny\r\ndeny from 123.456.789.01\r\ndeny from 12.123.456.78\r\ndeny from 234.56.789.123\r\nallow from all<\/pre>\r\n<img class=\"alignnone size-full wp-image-23029\" src=\"https:\/\/xneelo.co.za\/help-centre\/wp-content\/uploads\/2018\/10\/kh-file_manager-htaccess.png\" alt=\"\" width=\"1000\" height=\"366\" \/>\r\n\r\n&nbsp;"},"excerpt":{"rendered":"<p>Malicious or unwanted traffic to your website can be blocked by adding a snippet of code to the .htaccess file within your site content.<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"lsx_disable_title":"0","_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","footnotes":""},"categories":[166],"tags":[21536,20950,20947],"topics":[10403],"class_list":["post-23025","post","type-post","status-publish","format-standard","hentry","category-website","tag-block-ips","tag-block-ips-using-htaccess","tag-how-to-block-unwanted-traffic-to-your-website-from-specific-ips","topics-konsoleh-tools"],"acf":[],"additional_meta":{"category_title":[{"term_id":166,"name":"Website","slug":"website","term_group":0,"term_taxonomy_id":166,"taxonomy":"category","description":"About your Website(s)","parent":0,"count":169,"filter":"raw","term_order":"120","cat_ID":166,"category_count":169,"category_description":"About your Website(s)","cat_name":"Website","category_nicename":"website","category_parent":0}],"tag_title":[{"term_id":21536,"name":"block ips","slug":"block-ips","term_group":0,"term_taxonomy_id":21536,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw","term_order":"970"},{"term_id":20950,"name":"Block IP's using .htaccess","slug":"block-ips-using-htaccess","term_group":0,"term_taxonomy_id":20950,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw","term_order":"1150"},{"term_id":20947,"name":"How to block unwanted traffic to your website from specific IP's","slug":"how-to-block-unwanted-traffic-to-your-website-from-specific-ips","term_group":0,"term_taxonomy_id":20947,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw","term_order":"1151"}]},"featured_image_src":null,"author_info":{"display_name":"janine","author_link":"https:\/\/xneelo.co.za\/help-centre\/author\/janine\/","author_avatar":"https:\/\/secure.gravatar.com\/avatar\/aa7eb245072caa276e9df6888f1456c90cbf5304bea0210152b08c26141c638e?s=96&d=mm&r=g"},"_links":{"self":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts\/23025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/comments?post=23025"}],"version-history":[{"count":0,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts\/23025\/revisions"}],"wp:attachment":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/media?parent=23025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/categories?post=23025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/tags?post=23025"},{"taxonomy":"topics","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/topics?post=23025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}