{"id":740,"date":"2019-02-21T15:02:17","date_gmt":"2019-02-21T15:02:17","guid":{"rendered":"https:\/\/www.onfocus.co.uk\/?p=740"},"modified":"2019-02-21T15:04:48","modified_gmt":"2019-02-21T15:04:48","slug":"stop-showing-index-of-directory","status":"publish","type":"post","link":"https:\/\/www.onfocus.co.uk\/blog\/stop-showing-index-of-directory\/","title":{"rendered":"Stop Showing Index of \/directory"},"content":{"rendered":"\n<p>Do you get an Index of your website directory files similar to below when something goes wrong? Maybe a spelling mistake \/ typo or in this case a directory without an index file..<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"529\" height=\"249\" src=\"https:\/\/www.onfocus.co.uk\/blog\/wp-content\/uploads\/2019\/02\/index-of-directory.png\" alt=\"\" class=\"wp-image-741\" srcset=\"https:\/\/www.onfocus.co.uk\/blog\/wp-content\/uploads\/2019\/02\/index-of-directory.png 529w, https:\/\/www.onfocus.co.uk\/blog\/wp-content\/uploads\/2019\/02\/index-of-directory-300x141.png 300w, https:\/\/www.onfocus.co.uk\/blog\/wp-content\/uploads\/2019\/02\/index-of-directory-520x245.png 520w\" sizes=\"(max-width: 529px) 100vw, 529px\" \/><\/figure>\n\n\n\n<p>I was having this problem when the website address wasn&#8217;t being entered fully. And because I was using  .htaccess to force file type I did not have or need a index.html file in this directory.<\/p>\n\n\n\n<p>So trying www.website.co.uk\/directory\/<strong>info<\/strong>\/thisfile.html would process the info file and work as required but when mistyping or leaving off <strong>info<\/strong>\/thisfile.html  it would result in displaying the Index of\/ directory files. Not really something that you would want revealed.<\/p>\n\n\n\n<p>I tried searching around for a fix and to stop directory browsing and showing my file structure turned out for me to be an easy fix of adding the following code to my .htaccess file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Options -Indexes<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Do you get an Index of your website directory files similar to below when something goes wrong? Maybe a spelling mistake \/ typo or in this case a directory without an index file.. I&#46;&#46;&#46;<\/p>\n","protected":false},"author":3,"featured_media":741,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[53,54],"class_list":["post-740","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website-design","tag-htaccess","tag-website-help"],"_links":{"self":[{"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/posts\/740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=740"}],"version-history":[{"count":2,"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/posts\/740\/revisions"}],"predecessor-version":[{"id":743,"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/posts\/740\/revisions\/743"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/media\/741"}],"wp:attachment":[{"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onfocus.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}