{"id":41,"date":"2004-12-08T17:03:00","date_gmt":"2004-12-08T17:03:00","guid":{"rendered":"http:\/\/markwilson.me.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm"},"modified":"2007-03-16T11:47:24","modified_gmt":"2007-03-16T11:47:24","slug":"preventing-listing-contents-of","status":"publish","type":"post","link":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm","title":{"rendered":"Preventing listing the contents of a directory on an Apache web server"},"content":{"rendered":"<p><!--110252259100145182-->When no default document is found on a web server, depending on the server configuration, users may be able to list the files in a given directory. For Apache servers, this may be prevented on a per-directory basis by adding add an IndexIgnore directive to an <a href=\"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/using-htaccess-to-improve-user.htm\">.htaccess<\/a> file.<\/p>\n<p>The syntax is:<\/p>\n<p><code>IndexIgnore file [file] ...<\/code><\/p>\n<p>For example, <code>IndexIgnore *<\/code> will prevent listing of all files, or alternatively, individual files may be specified.<\/p>\n<p>Full details may be found in the <a href=\"http:\/\/httpd.apache.org\/docs-2.0\/mod\/mod_autoindex.html#indexignore\">Apache HTTP Server documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When no default document is found on a web server, depending on the server configuration, users may be able to list the files in a given directory. For Apache servers, this may be prevented on a per-directory basis by adding add an IndexIgnore directive to an .htaccess file. The syntax is: IndexIgnore file [file] &#8230; &hellip; <a href=\"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Preventing listing the contents of a directory on an Apache web server<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[90,29],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","tag-apache","tag-website-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Preventing listing the contents of a directory on an Apache web server - markwilson.it<\/title>\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.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Preventing listing the contents of a directory on an Apache web server - markwilson.it\" \/>\n<meta property=\"og:description\" content=\"When no default document is found on a web server, depending on the server configuration, users may be able to list the files in a given directory. For Apache servers, this may be prevented on a per-directory basis by adding add an IndexIgnore directive to an .htaccess file. The syntax is: IndexIgnore file [file] ... &hellip; Continue reading Preventing listing the contents of a directory on an Apache web server\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm\" \/>\n<meta property=\"og:site_name\" content=\"markwilson.it\" \/>\n<meta property=\"article:published_time\" content=\"2004-12-08T17:03:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2007-03-16T11:47:24+00:00\" \/>\n<meta name=\"author\" content=\"Mark Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@markwilsonit\" \/>\n<meta name=\"twitter:site\" content=\"@markwilsonit\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mark Wilson\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm\"},\"author\":{\"name\":\"Mark Wilson\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"headline\":\"Preventing listing the contents of a directory on an Apache web server\",\"datePublished\":\"2004-12-08T17:03:00+00:00\",\"dateModified\":\"2007-03-16T11:47:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm\"},\"wordCount\":89,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"keywords\":[\"Apache\",\"Website Development\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm\",\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm\",\"name\":\"Preventing listing the contents of a directory on an Apache web server - markwilson.it\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#website\"},\"datePublished\":\"2004-12-08T17:03:00+00:00\",\"dateModified\":\"2007-03-16T11:47:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2004\\\/12\\\/preventing-listing-contents-of.htm#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Preventing listing the contents of a directory on an Apache web server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/\",\"name\":\"markwilson.it\",\"description\":\"get-info -class technology | write-output &gt; \\\/dev\\\/web\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\",\"name\":\"Mark Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"width\":800,\"height\":800,\"caption\":\"Mark Wilson\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\"},\"description\":\"A Chartered IT Professional, with recent experience in technology leadership, IT strategy and practice management roles, Mark Wilson is an Enterprise Architect in the Advisory and Management Group at risual. During a career spanning more than two decades, Mark has gained widespread recognition as an expert in his field including both industry and national press exposure. In addition to certifications from Microsoft, VMware, Red Hat, The Open Group and Axelos, Mark held a Microsoft Most Valuable Professional (MVP) award for three years and is now part of the MVP Reconnect programme. Mark is also well-known on social media and maintains an award-winning blog.\",\"sameAs\":[\"http:\\\/\\\/www.markwilson.co.uk\\\/\",\"https:\\\/\\\/www.instagram.com\\\/markwilsonuk\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/markawilson\\\/\",\"https:\\\/\\\/x.com\\\/markwilsonit\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCWHlZCoHRTocdvtrOJ2IL4A\"],\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/author\\\/mark-wilson\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Preventing listing the contents of a directory on an Apache web server - markwilson.it","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.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm","og_locale":"en_GB","og_type":"article","og_title":"Preventing listing the contents of a directory on an Apache web server - markwilson.it","og_description":"When no default document is found on a web server, depending on the server configuration, users may be able to list the files in a given directory. For Apache servers, this may be prevented on a per-directory basis by adding add an IndexIgnore directive to an .htaccess file. The syntax is: IndexIgnore file [file] ... &hellip; Continue reading Preventing listing the contents of a directory on an Apache web server","og_url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm","og_site_name":"markwilson.it","article_published_time":"2004-12-08T17:03:00+00:00","article_modified_time":"2007-03-16T11:47:24+00:00","author":"Mark Wilson","twitter_card":"summary_large_image","twitter_creator":"@markwilsonit","twitter_site":"@markwilsonit","twitter_misc":{"Written by":"Mark Wilson"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm#article","isPartOf":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm"},"author":{"name":"Mark Wilson","@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"headline":"Preventing listing the contents of a directory on an Apache web server","datePublished":"2004-12-08T17:03:00+00:00","dateModified":"2007-03-16T11:47:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm"},"wordCount":89,"commentCount":0,"publisher":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"keywords":["Apache","Website Development"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm","url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm","name":"Preventing listing the contents of a directory on an Apache web server - markwilson.it","isPartOf":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#website"},"datePublished":"2004-12-08T17:03:00+00:00","dateModified":"2007-03-16T11:47:24+00:00","breadcrumb":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/preventing-listing-contents-of.htm#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.markwilson.co.uk\/blog"},{"@type":"ListItem","position":2,"name":"Preventing listing the contents of a directory on an Apache web server"}]},{"@type":"WebSite","@id":"https:\/\/www.markwilson.co.uk\/blog\/#website","url":"https:\/\/www.markwilson.co.uk\/blog\/","name":"markwilson.it","description":"get-info -class technology | write-output &gt; \/dev\/web","publisher":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.markwilson.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468","name":"Mark Wilson","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","url":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","width":800,"height":800,"caption":"Mark Wilson"},"logo":{"@id":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1"},"description":"A Chartered IT Professional, with recent experience in technology leadership, IT strategy and practice management roles, Mark Wilson is an Enterprise Architect in the Advisory and Management Group at risual. During a career spanning more than two decades, Mark has gained widespread recognition as an expert in his field including both industry and national press exposure. In addition to certifications from Microsoft, VMware, Red Hat, The Open Group and Axelos, Mark held a Microsoft Most Valuable Professional (MVP) award for three years and is now part of the MVP Reconnect programme. Mark is also well-known on social media and maintains an award-winning blog.","sameAs":["http:\/\/www.markwilson.co.uk\/","https:\/\/www.instagram.com\/markwilsonuk\/","https:\/\/www.linkedin.com\/in\/markawilson\/","https:\/\/x.com\/markwilsonit","https:\/\/www.youtube.com\/channel\/UCWHlZCoHRTocdvtrOJ2IL4A"],"url":"https:\/\/www.markwilson.co.uk\/blog\/author\/mark-wilson"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":466,"url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/using-htaccess-to-improve-user.htm","url_meta":{"origin":41,"position":0},"title":"Using .htaccess to improve the user experience for a website running on an Apache server","author":"Mark Wilson","date":"Wednesday 8 December 2004","format":false,"excerpt":"A few weeks back, I updated two websites (which run on my ISPs' Apache servers) to use various features which improve the experience for users of the site. These features include: Server side includes (SSI). Changing the default web page. Providing custom error messages. Redirecting clients where pages have changed.\u2026","rel":"","context":"In \"Apache\"","block_context":{"text":"Apache","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/apache"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":394,"url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/using-server-side-includes-in-web.htm","url_meta":{"origin":41,"position":1},"title":"Using server side includes in web pages","author":"Mark Wilson","date":"Wednesday 8 December 2004","format":false,"excerpt":"One of the features used in my website is server side includes (SSI). The SSI code allows my sites to include dynamic information which would otherwise require scripting that may not function correctly with certain browsers. SSI is pretty simple. Apache users need to edit the .htaccess file in their\u2026","rel":"","context":"In \"Apache\"","block_context":{"text":"Apache","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/apache"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":148,"url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/redirecting-clients-when-websites.htm","url_meta":{"origin":41,"position":2},"title":"Redirecting clients when websites change","author":"Mark Wilson","date":"Wednesday 8 December 2004","format":false,"excerpt":"Whilst looking at the website statistics for my main website, I realised that many users were attempting to access pages that no longer exist on the server. Some may argue that old content should be left in place, but others will disagree and my preferred approach is to redirect requests\u2026","rel":"","context":"In \"Apache\"","block_context":{"text":"Apache","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/apache"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":40,"url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/denying-access-to-certain-files-on.htm","url_meta":{"origin":41,"position":3},"title":"Denying access to certain files on an Apache web server","author":"Mark Wilson","date":"Wednesday 8 December 2004","format":false,"excerpt":"Under certain circumstances, it may be necessary to deny users access to various files on a web server. For example, some directives in an Apache .htaccess file may be considered a security risk and so access to the file may be prevented using the following directives: <files .htaccess> order deny,allow\u2026","rel":"","context":"In \"Apache\"","block_context":{"text":"Apache","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/apache"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":150,"url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/changing-default-documents-for-website.htm","url_meta":{"origin":41,"position":4},"title":"Changing the default documents for a website","author":"Mark Wilson","date":"Wednesday 8 December 2004","format":false,"excerpt":"My ISPs' Apache servers are configured for index.html and index.htm to be the default documents; however since implementing server side includes in my websites I need index.shtml to be recognised as the default document. Fortunately, this can be achieved using the following directive in the corresponding .htaccess file: DirectoryIndex index.shtml\u2026","rel":"","context":"In \"Apache\"","block_context":{"text":"Apache","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/apache"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":257,"url":"https:\/\/www.markwilson.co.uk\/blog\/2004\/12\/implementing-custom-error-pages-for.htm","url_meta":{"origin":41,"position":5},"title":"Implementing custom error pages for a website","author":"Mark Wilson","date":"Wednesday 8 December 2004","format":false,"excerpt":"One of the features used in my website is custom error pages, which allow errors to be handled using a format that matches other documents on the site. Apache users can configure custom error messages using .htaccess. Once pages have been created for an error message, include a directive in\u2026","rel":"","context":"In \"Apache\"","block_context":{"text":"Apache","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/apache"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":0,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}