{"id":14460,"date":"2021-10-25T14:58:52","date_gmt":"2021-10-25T14:58:52","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=14460"},"modified":"2026-02-27T12:28:26","modified_gmt":"2026-02-27T06:58:26","slug":"enable-disable-directory-listing-htaccess-cpanel","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/","title":{"rendered":"How to Enable\/Disable Directory Listing with .htaccess via cPanel?"},"content":{"rendered":"<p><strong>Watch this video for a step by step process on How to Enable\/Disable Directory Listing with .htaccess via cPanel<\/strong><\/p>\n<div class=\"youtube-video\" style=\"border: 1px solid #ddd;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/hxyMX1gKxRQ\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<p>Directory listing is a crucial part of <a href=\"https:\/\/www.milesweb.in\/\" target=\"_blank\" rel=\"noopener\">web hosting<\/a>. As a cPanel user, you can enable or disable directory listing with .htaccess.<\/p>\n<p>For security reasons, it is common for web servers to disable directory listing. You will get a 403 HTTP Forbidden Access error if you don\u2019t have an index file in a directory. It does not allow the client to see the files in the directory. If you want to show these files, you have to enable the directory listing.<\/p>\n<h2>To Enable Directory Listing with .htaccess<\/h2>\n<p>1. Create a .htaccess file in the cPanel File Manager.<\/p>\n<p>Just name the file as <em>.htaccess<\/em>.<\/p>\n<p>If you already have the .htaccess file, find and edit the&nbsp;file in the cPanel File Manager.<\/p>\n<p>For users who don&#8217;t know how to create\/edit .htaccess file, refer to the article:&nbsp;<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-edit-a-htaccess-file-through-the-cpanel-file-manager\/\">How To Edit A .htaccess File Through The cPanel File Manager?<\/a><\/p>\n<p>2. Enter\/copy this code at the beginning of the file:<\/p>\n<pre class=\"font-size:15 line-height:20 lang:default decode:true\">Options +Indexes<\/pre>\n<p>3. Click <strong>Save Changes<\/strong> and <strong>Close<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13603\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg\" alt=\"\" width=\"1599\" height=\"464\"><\/p>\n<p>The next time you browse for the directory listing, it will display the index.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13604\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_htaccess_enable_dir_listing.jpg\" alt=\"\" width=\"643\" height=\"370\"><\/p>\n<h2>To Disable Directory Listing with .htaccess<\/h2>\n<p>1. Create\/edit the .htaccess file in cPanel File Manager.<\/p>\n<p>2. Enter\/copy this code at the beginning of the file:<\/p>\n<pre class=\"font-size:15 line-height:20 lang:default decode:true\">Options -Indexes<\/pre>\n<p>3. Click <strong>Save Changes<\/strong> and <strong>Close<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13605\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_disable_dir_listing.jpg\" alt=\"\" width=\"1599\" height=\"464\"><\/p>\n<p>The next time you browse for the directory listing, it will display the <em>403 HTTP Forbidden Access<\/em> error.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13606\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_htaccess_disable_dir_listing.jpg\" alt=\"\" width=\"568\" height=\"368\"><\/p>\n<p>That is how you can configure the .htaccess file via cPanel to enable\/disable directory listing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Watch this video for a step by step process on How to Enable\/Disable Directory Listing with .htaccess via cPanel Directory listing is a crucial part of web hosting. As a cPanel user, you can enable or disable directory listing with .htaccess. For security reasons, it is common for web servers to disable directory listing. You [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3046],"tags":[627,49,2626,2625,2628,2627],"class_list":["post-14460","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-files-and-ftp-management","tag-htaccess-file","tag-cpanel-control-panel","tag-directory-listing","tag-directory-listing-htaccess-cpanel","tag-disable-directory-listing","tag-enable-directory-listing"],"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 Enable\/Disable Directory Listing with .htaccess via cPanel?<\/title>\n<meta name=\"description\" content=\"This tutorial is for cPanel users who want to configure the .htaccess file via cPanel so as to enable\/disable directory listing.\" \/>\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.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable\/Disable Directory Listing with .htaccess via cPanel?\" \/>\n<meta property=\"og:description\" content=\"This tutorial is for cPanel users who want to configure the .htaccess file via cPanel so as to enable\/disable directory listing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-25T14:58:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-27T06:58:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2015\/04\/webmail_editor_type.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"529\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Prasad Khartadkar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasad Khartadkar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/\"},\"author\":{\"name\":\"Prasad Khartadkar\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\"},\"headline\":\"How to Enable\/Disable Directory Listing with .htaccess via cPanel?\",\"datePublished\":\"2021-10-25T14:58:52+00:00\",\"dateModified\":\"2026-02-27T06:58:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/\"},\"wordCount\":270,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg\",\"keywords\":[\".htaccess file\",\"cPanel control panel\",\"directory listing\",\"directory listing htaccess cpanel\",\"disable directory listing\",\"enable directory listing\"],\"articleSection\":[\"Files &amp; FTP Management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/\",\"name\":\"How to Enable\/Disable Directory Listing with .htaccess via cPanel?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg\",\"datePublished\":\"2021-10-25T14:58:52+00:00\",\"dateModified\":\"2026-02-27T06:58:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\"},\"description\":\"This tutorial is for cPanel users who want to configure the .htaccess file via cPanel so as to enable\/disable directory listing.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg\",\"width\":1599,\"height\":464},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Enable\/Disable Directory Listing with .htaccess via cPanel?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e\",\"name\":\"Prasad Khartadkar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg\",\"caption\":\"Prasad Khartadkar\"},\"description\":\"Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/prasad-khartadkar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable\/Disable Directory Listing with .htaccess via cPanel?","description":"This tutorial is for cPanel users who want to configure the .htaccess file via cPanel so as to enable\/disable directory listing.","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.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable\/Disable Directory Listing with .htaccess via cPanel?","og_description":"This tutorial is for cPanel users who want to configure the .htaccess file via cPanel so as to enable\/disable directory listing.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2021-10-25T14:58:52+00:00","article_modified_time":"2026-02-27T06:58:26+00:00","og_image":[{"width":1600,"height":529,"url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2015\/04\/webmail_editor_type.jpg","type":"image\/jpeg"}],"author":"Prasad Khartadkar","twitter_misc":{"Written by":"Prasad Khartadkar","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/"},"author":{"name":"Prasad Khartadkar","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e"},"headline":"How to Enable\/Disable Directory Listing with .htaccess via cPanel?","datePublished":"2021-10-25T14:58:52+00:00","dateModified":"2026-02-27T06:58:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/"},"wordCount":270,"commentCount":0,"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg","keywords":[".htaccess file","cPanel control panel","directory listing","directory listing htaccess cpanel","disable directory listing","enable directory listing"],"articleSection":["Files &amp; FTP Management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/","name":"How to Enable\/Disable Directory Listing with .htaccess via cPanel?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg","datePublished":"2021-10-25T14:58:52+00:00","dateModified":"2026-02-27T06:58:26+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e"},"description":"This tutorial is for cPanel users who want to configure the .htaccess file via cPanel so as to enable\/disable directory listing.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#primaryimage","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/10\/cp_edit_htaccess_enable_dir_listing.jpg","width":1599,"height":464},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/enable-disable-directory-listing-htaccess-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Enable\/Disable Directory Listing with .htaccess via cPanel?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/c9138a9488172a8d0aa2d4f40878d83e","name":"Prasad Khartadkar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/08\/Prasad-K.-1-150x150.jpg","caption":"Prasad Khartadkar"},"description":"Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/prasad-khartadkar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=14460"}],"version-history":[{"count":4,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14460\/revisions"}],"predecessor-version":[{"id":17556,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14460\/revisions\/17556"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=14460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=14460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=14460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}