{"id":3504,"date":"2015-02-04T21:29:08","date_gmt":"2015-02-04T21:29:08","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2015\/02\/04\/prevent-index-of-page-in-htaccess\/"},"modified":"2025-06-12T16:54:08","modified_gmt":"2025-06-12T20:54:08","slug":"prevent-index-of-page-in-htaccess","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/","title":{"rendered":"Preventing the &#8216;Index Of&#8217; page in .htaccess"},"content":{"rendered":"\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/CVMPPg-9GQk\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p>When working with your site there may be many files or folders. Ideally, most folders should have an index page of some sort. For our servers, they should be one of three names: <em>index.htm<\/em>, <em>index.html<\/em>, and <em>index.php<\/em>. As long as the folder contains at least one file with one of these names, it will display on the screen.<\/p>\n\n\n\n<p>If, however a folder does not contain one of these files, then it will simply display a list of all files and folders contained within. This is the default behavior, but you can also change it within the .htaccess file. This article will guide you on how to prevent the list showing, even if the index pages are not in the folder.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Prevent the <em>Index Of<\/em> page<\/h2>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Log into your cPanel dashboard<\/a>.<\/li>\n\n\n\n<li>Once in the cPanel, click on the <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\"><strong>File Manager<\/strong><\/a> icon, located in the <em>Files<\/em> category.<\/li>\n\n\n\n<li>Locate the <em>.htaccess<\/em> file and open it for editing.<\/li>\n\n\n\n<li>At the top of the file, add the following code: <pre>Options -Indexes<\/pre><\/li>\n\n\n\n<li><strong>Save<\/strong> and close the file.<\/li>\n<\/ol>\n\n\n\n<p>Now when someone visits a directory or folder that has no index file, it will receive a 403 Forbidden error instead of seeing a list of the directory&#8217;s contents. The 403 error indicates the visitor does not have access permissions to view that area.<\/p>\n\n\n<div class=\"jumbotron\" style=\"text-align:center;\">\r\n<p style=\"font-size: 24px;\"><strong>Professional Websites Without the Tech Headaches<\/strong><\/p>\r\n<p>Our team will build a beautiful WordPress site and take care of updates, security, and maintenance \u2013 so you can focus on running your business.<\/p>\r\n<p><a class=\"btn btn-primary btn-lg\" href=\"https:\/\/www.inmotionhosting.com\/services?mktgp=t&irgwc=1&affiliates=5001860&utm_campaign=Jumbotron&utm_source=supportcenter&utm_medium=cta&utm_term=pro-websites-cta3\">Let Us Handle It for You<\/a><\/p>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>When working with your site there may be many files or folders. Ideally, most folders should have an index page of some sort. For our servers, they should be one of three names: index.htm, index.html, and index.php. As long as the folder contains at least one file with one of these names, it will display<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\"> Read More ><\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4288],"tags":[],"class_list":["post-3504","post","type-post","status-publish","format-standard","hentry","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Prevent and Fix the Index Of \/ page in htaccess<\/title>\n<meta name=\"description\" content=\"If a folder does not contain an index file, then it will simply display a list of all files and folders contained within. Here&#039;s how you can fix it.\" \/>\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.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Prevent and Fix the Index Of \/ page in htaccess\" \/>\n<meta property=\"og:description\" content=\"If a folder does not contain an index file, then it will simply display a list of all files and folders contained within. Here&#039;s how you can fix it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-04T21:29:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-12T20:54:08+00:00\" \/>\n<meta name=\"author\" content=\"Scott Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Scott Mitchell\" \/>\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.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\"},\"author\":{\"name\":\"Scott Mitchell\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\"},\"headline\":\"Preventing the &#8216;Index Of&#8217; page in .htaccess\",\"datePublished\":\"2015-02-04T21:29:08+00:00\",\"dateModified\":\"2025-06-12T20:54:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\"},\"wordCount\":228,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\",\"name\":\"How to Prevent and Fix the Index Of \/ page in htaccess\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2015-02-04T21:29:08+00:00\",\"dateModified\":\"2025-06-12T20:54:08+00:00\",\"description\":\"If a folder does not contain an index file, then it will simply display a list of all files and folders contained within. Here's how you can fix it.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Preventing the &#8216;Index Of&#8217; page in .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\",\"name\":\"Scott Mitchell\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Prevent and Fix the Index Of \/ page in htaccess","description":"If a folder does not contain an index file, then it will simply display a list of all files and folders contained within. Here's how you can fix 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.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to Prevent and Fix the Index Of \/ page in htaccess","og_description":"If a folder does not contain an index file, then it will simply display a list of all files and folders contained within. Here's how you can fix it.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2015-02-04T21:29:08+00:00","article_modified_time":"2025-06-12T20:54:08+00:00","author":"Scott Mitchell","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Scott Mitchell","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/"},"author":{"name":"Scott Mitchell","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed"},"headline":"Preventing the &#8216;Index Of&#8217; page in .htaccess","datePublished":"2015-02-04T21:29:08+00:00","dateModified":"2025-06-12T20:54:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/"},"wordCount":228,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/","name":"How to Prevent and Fix the Index Of \/ page in htaccess","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2015-02-04T21:29:08+00:00","dateModified":"2025-06-12T20:54:08+00:00","description":"If a folder does not contain an index file, then it will simply display a list of all files and folders contained within. Here's how you can fix it.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/prevent-index-of-page-in-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Preventing the &#8216;Index Of&#8217; page in .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed","name":"Scott Mitchell","url":"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4288,"name":"Website","slug":"website","link":"https:\/\/www.inmotionhosting.com\/support\/website\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=3504"}],"version-history":[{"count":2,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3504\/revisions"}],"predecessor-version":[{"id":130471,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3504\/revisions\/130471"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=3504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=3504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=3504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}