{"id":1023,"date":"2024-06-02T13:04:41","date_gmt":"2024-06-02T13:04:41","guid":{"rendered":"https:\/\/kb.cloudhostgeek.com\/?p=1023"},"modified":"2025-11-05T10:48:47","modified_gmt":"2025-11-05T10:48:47","slug":"how-to-enable-disable-directory-listing-using-htaccess-in-cpanel","status":"publish","type":"post","link":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/","title":{"rendered":"Steps to manage directory listing (enable\/disable) through .htaccess in cPanel"},"content":{"rendered":"\n<p>Directory listing, also known as indexing, allows web browsers to display a list of files and subdirectories within a folder when it&#8217;s accessed directly. While convenient for managing content, it can expose sensitive information for security reasons. cPanel offers functionalities within .htaccess files to enable or disable directory listing for specific directories on your website.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Enabling Directory Listing<\/strong><\/h3>\n\n\n\n<p>1. Log in to your cPanel account and navigate to the &#8220;<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">Files<\/mark><\/strong>&#8221; section. Locate and launch the &#8220;<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">File Manager<\/mark><\/strong>&#8221; tool.<\/p>\n\n\n\n<p>2. Within the File Manager, browse to the specific directory for which you want to enable directory listing.<\/p>\n\n\n\n<p>3.1 If a <strong><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">.htaccess<\/mark><\/code><\/strong> file doesn&#8217;t exist in the directory, create a new file named exactly <strong>.<code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">htaccess<\/mark><\/code><\/strong> (ensure the leading dot).<\/p>\n\n\n\n<p>3.2 If a <strong><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">.htaccess<\/mark><\/code><\/strong> file already exists, open it for editing.<\/p>\n\n\n\n<p>4. At the beginning of the <strong><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">.htaccess<\/mark><\/code><\/strong> file, insert the following line:<\/p>\n\n\n\n<p><strong>\u00a0\u00a0<code>\u00a0\u00a0<mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">Options +Indexes<\/mark><\/code><\/strong><\/p>\n\n\n\n<p>5. Click the &#8220;<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">Save Changes<\/mark><\/strong>&#8221; button to implement the modifications and enable directory listing for the chosen directory.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Disabling Directory Listing<\/strong><\/h3>\n\n\n\n<p>Follow steps 1-2 from &#8220;<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">Enabling Directory Listing<\/mark><\/strong>&#8221; to access the File Manager and locate the desired directory.<\/p>\n\n\n\n<p>As described previously, create a new .<strong><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">htaccess<\/mark><\/code><\/strong> file if it doesn&#8217;t exist or open the existing one for editing.<\/p>\n\n\n\n<p>1. At the beginning of the <strong><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">.htaccess<\/mark><\/code><\/strong> file, insert the following line:<\/p>\n\n\n\n<p><strong><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">Options -Indexes<\/mark><\/code><\/strong><\/p>\n\n\n\n<p>2. Click the &#8220;<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#7a00df\" class=\"has-inline-color\">Save Changes<\/mark><\/strong>&#8221; button to implement the modifications and disable directory listing for the chosen directory.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Directory listing, also known as indexing, allows web browsers to display a list of files and subdirectories within a folder when it&#8217;s accessed directly. While convenient for managing content, it can expose sensitive information for security reasons. cPanel offers functionalities within .htaccess files to enable or disable directory listing for specific directories on your website. Enabling Directory Listing 1. Log in to your cPanel account and navigate to the &#8220;Files&#8221; section. Locate and launch the &#8220;File Manager&#8221; tool. 2. Within the File Manager, browse to the specific directory for which you want to enable directory listing. 3.1 If a .htaccess file doesn&#8217;t exist in the directory, create a new file named exactly .htaccess (ensure the leading dot). 3.2 If a .htaccess file already exists, open it for editing. 4. At the beginning of the .htaccess file, insert the following line: \u00a0\u00a0\u00a0\u00a0Options +Indexes 5. Click the &#8220;Save Changes&#8221; button to implement the modifications and enable directory listing for the chosen directory. Disabling Directory Listing Follow steps 1-2 from &#8220;Enabling Directory Listing&#8221; to access the File Manager and locate the desired directory. As described previously, create a new .htaccess file if it doesn&#8217;t exist or open the existing one for editing. 1. At the beginning of the .htaccess file, insert the following line: Options -Indexes 2. Click the &#8220;Save Changes&#8221; button to implement the modifications and disable directory listing for the chosen directory.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"elementor_theme","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":[],"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[24,5],"tags":[],"class_list":["post-1023","post","type-post","status-publish","format-standard","hentry","category-cp-website","category-cpanel","no-post-thumbnail"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.7 (Yoast SEO v26.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Steps to manage directory listing (enable\/disable) through .htaccess in cPanel - CloudHostGeek Help Center<\/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.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Steps to manage directory listing (enable\/disable) through .htaccess in cPanel\" \/>\n<meta property=\"og:description\" content=\"Directory listing, also known as indexing, allows web browsers to display a list of files and subdirectories within a folder when it&#8217;s accessed directly. While convenient for managing content, it can expose sensitive information for security reasons. cPanel offers functionalities within .htaccess files to enable or disable directory listing for specific directories on your website. Enabling Directory Listing 1. Log in to your cPanel account and navigate to the &#8220;Files&#8221; section. Locate and launch the &#8220;File Manager&#8221; tool. 2. Within the File Manager, browse to the specific directory for which you want to enable directory listing. 3.1 If a .htaccess file doesn&#8217;t exist in the directory, create a new file named exactly .htaccess (ensure the leading dot). 3.2 If a .htaccess file already exists, open it for editing. 4. At the beginning of the .htaccess file, insert the following line: \u00a0\u00a0\u00a0\u00a0Options +Indexes 5. Click the &#8220;Save Changes&#8221; button to implement the modifications and enable directory listing for the chosen directory. Disabling Directory Listing Follow steps 1-2 from &#8220;Enabling Directory Listing&#8221; to access the File Manager and locate the desired directory. As described previously, create a new .htaccess file if it doesn&#8217;t exist or open the existing one for editing. 1. At the beginning of the .htaccess file, insert the following line: Options -Indexes 2. Click the &#8220;Save Changes&#8221; button to implement the modifications and disable directory listing for the chosen directory.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"CloudHostGeek Help Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BigCloudyHosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-02T13:04:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-05T10:48:47+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bigcloudypvtltd\" \/>\n<meta name=\"twitter:site\" content=\"@bigcloudypvtltd\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Steps to manage directory listing (enable\/disable) through .htaccess in cPanel - CloudHostGeek Help Center","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.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"Steps to manage directory listing (enable\/disable) through .htaccess in cPanel","og_description":"Directory listing, also known as indexing, allows web browsers to display a list of files and subdirectories within a folder when it&#8217;s accessed directly. While convenient for managing content, it can expose sensitive information for security reasons. cPanel offers functionalities within .htaccess files to enable or disable directory listing for specific directories on your website. Enabling Directory Listing 1. Log in to your cPanel account and navigate to the &#8220;Files&#8221; section. Locate and launch the &#8220;File Manager&#8221; tool. 2. Within the File Manager, browse to the specific directory for which you want to enable directory listing. 3.1 If a .htaccess file doesn&#8217;t exist in the directory, create a new file named exactly .htaccess (ensure the leading dot). 3.2 If a .htaccess file already exists, open it for editing. 4. At the beginning of the .htaccess file, insert the following line: \u00a0\u00a0\u00a0\u00a0Options +Indexes 5. Click the &#8220;Save Changes&#8221; button to implement the modifications and enable directory listing for the chosen directory. Disabling Directory Listing Follow steps 1-2 from &#8220;Enabling Directory Listing&#8221; to access the File Manager and locate the desired directory. As described previously, create a new .htaccess file if it doesn&#8217;t exist or open the existing one for editing. 1. At the beginning of the .htaccess file, insert the following line: Options -Indexes 2. Click the &#8220;Save Changes&#8221; button to implement the modifications and disable directory listing for the chosen directory.","og_url":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/","og_site_name":"CloudHostGeek Help Center","article_publisher":"https:\/\/www.facebook.com\/BigCloudyHosting\/","article_published_time":"2024-06-02T13:04:41+00:00","article_modified_time":"2025-11-05T10:48:47+00:00","author":"admin","twitter_card":"summary_large_image","twitter_creator":"@bigcloudypvtltd","twitter_site":"@bigcloudypvtltd","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/#article","isPartOf":{"@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/"},"author":{"name":"admin","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#\/schema\/person\/378209d3259734d846716786afbc52b0"},"headline":"Steps to manage directory listing (enable\/disable) through .htaccess in cPanel","datePublished":"2024-06-02T13:04:41+00:00","dateModified":"2025-11-05T10:48:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/"},"wordCount":227,"publisher":{"@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#organization"},"articleSection":["CP Website","cPanel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/","url":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/","name":"Steps to manage directory listing (enable\/disable) through .htaccess in cPanel - CloudHostGeek Help Center","isPartOf":{"@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#website"},"datePublished":"2024-06-02T13:04:41+00:00","dateModified":"2025-11-05T10:48:47+00:00","breadcrumb":{"@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/how-to-enable-disable-directory-listing-using-htaccess-in-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bigcloudy.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Steps to manage directory listing (enable\/disable) through .htaccess in cPanel"}]},{"@type":"WebSite","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#website","url":"https:\/\/www.bigcloudy.com\/knowledge-base\/","name":"https:\/\/www.bigcloudy.com\/","description":"Your step-by-step guide to hosting, servers &amp; website tools.","publisher":{"@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bigcloudy.com\/knowledge-base\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#organization","name":"BigCloudy internt services pvt ltd.","url":"https:\/\/www.bigcloudy.com\/knowledge-base\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#\/schema\/logo\/image\/","url":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-content\/uploads\/2024\/09\/cropped-BGC_logo.webp","contentUrl":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-content\/uploads\/2024\/09\/cropped-BGC_logo.webp","width":368,"height":114,"caption":"BigCloudy internt services pvt ltd."},"image":{"@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/BigCloudyHosting\/","https:\/\/x.com\/bigcloudypvtltd","https:\/\/www.instagram.com\/bigcloudypvtltd\/"]},{"@type":"Person","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#\/schema\/person\/378209d3259734d846716786afbc52b0","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bigcloudy.com\/knowledge-base\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/42ea90e921e5926f1db3403e79195ea7c0e898504fd43555e6099a85c9c91443?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/42ea90e921e5926f1db3403e79195ea7c0e898504fd43555e6099a85c9c91443?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/kb.cloudhostgeek.com"]}]}},"_links":{"self":[{"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/1023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=1023"}],"version-history":[{"count":0,"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/1023\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=1023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=1023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bigcloudy.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=1023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}