{"id":33738,"date":"2016-09-19T10:45:46","date_gmt":"2016-09-19T10:45:46","guid":{"rendered":"https:\/\/hostduplex.com\/kb\/?p=192"},"modified":"2016-09-19T10:45:46","modified_gmt":"2016-09-19T10:45:46","slug":"how-to-restrict-directory-access-by-ip-address","status":"publish","type":"post","link":"https:\/\/www.hostduplex.com\/kb\/how-to-restrict-directory-access-by-ip-address\/","title":{"rendered":"How to restrict directory access by IP address?"},"content":{"rendered":"<p><span style=\"font-size: medium;\">To secure your admin area from hackers, we recommend that you allow access only from a selected IP address to your admin directory. You need to create a .htaccess file in the directory where you want to restrict access to specific IP addresses.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\">For example, if you have a WordPress blog installed on your main directory and log in via example.com\/wp-admin, you should create an .htaccess file in <strong>\/wp-admin\/.htaccess<\/strong>, and you should put the following code into it. Don&#8217;t forget to replace the allowed IP address with your IP address.<\/span><\/p>\n<pre class=\"language-markup\"><code>order deny, allow\ndeny from all\nallow from YOUR-IP-ADDRESS-HERE<\/code><\/pre>\n<p><span style=\"font-size: medium;\">(Replace &#8220;<strong>Your-IP-Address-Here<\/strong>&#8221; text with your IP Address)<\/span><\/p>\n<p><span style=\"font-size: medium;\">You can test this by accessing your \/wp-admin IP address from another IP address, which is not mentioned in your .htaccess file.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To secure your admin area from hackers, we recommend that you allow access only from a selected IP address to your admin directory. You need to create a .htaccess file in the directory where you want to restrict access to specific IP addresses. &nbsp; For example, if you have a&#8230;<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[83],"tags":[],"class_list":["post-33738","post","type-post","status-publish","format-standard","hentry","category-security-cpanel"],"_links":{"self":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/posts\/33738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/comments?post=33738"}],"version-history":[{"count":0,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/posts\/33738\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/media?parent=33738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/categories?post=33738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/tags?post=33738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}