{"id":3479,"date":"2024-03-13T08:33:00","date_gmt":"2024-03-13T06:33:00","guid":{"rendered":"https:\/\/www.mcloud9.com\/blog\/?p=3479"},"modified":"2024-12-22T17:19:58","modified_gmt":"2024-12-22T15:19:58","slug":"how-to-disable-directory-listing-in-cpanel","status":"publish","type":"post","link":"https:\/\/www.mcloud9.com\/blog\/how-to-disable-directory-listing-in-cpanel\/","title":{"rendered":"How To Disable Directory Listing in cPanel &#8211; Simple Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Building your online presence is a thrilling journey, but it&#8217;s vital to keep it secure too. In this article, we&#8217;re diving into a fundamental aspect of website security: how to disable directory listing in your cPanel control panel. Don&#8217;t worry, it&#8217;s not as complex as it sounds, and by the end of this guide, you&#8217;ll be a pro at keeping your website directories private and secure.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#understanding-directory-listing-and-its-implications\">Understanding Directory Listing and Its Implications<\/a><\/li><li><a href=\"#steps-for-disabling-directory-listing-in-cpanel\">Steps for Disabling Directory Listing in cPanel<\/a><ul><li><a href=\"#option-1-disabling-directory-browsing-with-cpanel-s-indexes-tool\">Option 1: Disabling Directory Browsing With cPanel&#8217;s Indexes Tool<\/a><\/li><li><a href=\"#option-2-disabling-directory-browsing-in-cpanel-s-file-manager\">Option 2: Disabling Directory Browsing in cPanel&#8217;s File Manager<\/a><\/li><li><a href=\"#option-3-manually-creating-index-files-to-prevent-directory-listing\">Option 3: Manually Creating Index Files To Prevent Directory Listing<\/a><\/li><li><a href=\"#option-4-configuring-htaccess-to-turn-off-directory-listing\">Option 4: Configuring .htaccess To Turn off Directory Listing<\/a><\/li><\/ul><\/li><li><a href=\"#checking-directory-listing-status\">Checking Directory Listing Status<\/a><\/li><li><a href=\"#faq-for-disabling-directory-listings\">FAQ for Disabling Directory Listings<\/a><ul><\/ul><\/li><li><a href=\"#in-conclusion\">In Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"understanding-directory-listing-and-its-implications\">Understanding Directory Listing and Its Implications<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your website is made up of multiple directories and files. Directory listing allows any visitor to browse through your directories seeing all the file and folder names without restrictions. It might seem harmless, but it exposes the contents of your website&#8217;s folders, potentially <a href=\"https:\/\/portswigger.net\/web-security\/information-disclosure\/exploiting#directory-listings\" target=\"_blank\" rel=\"noreferrer noopener\">compromising sensitive data<\/a> or information you&#8217;d prefer to keep private.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c4b9c&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c4b9c\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"321\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Image-of-web-server-directory-list.png\" alt=\"Image of web server directory list\" class=\"wp-image-3503\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Image-of-web-server-directory-list.png 541w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Image-of-web-server-directory-list-300x178.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Image of a public directory listing (source: Wikimedia Commons)<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"steps-for-disabling-directory-listing-in-c-panel\">Steps for Disabling Directory Listing in cPanel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s get to the heart of the matter\u2014how to disable directory listing. Luckily, <a href=\"\/blog\/what-is-cpanel\">cPanel<\/a> offers multiple ways to safeguard your folders:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"option-1-disabling-directory-browsing-with-c-panels-indexes-tool\">Option 1: Disabling Directory Browsing With cPanel&#8217;s Indexes Tool<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">cPanel provides multiple ways you can disable directory listing. One of the simplest ways it to use the &#8216;Indexes&#8217; tool. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>Log in to your cPanel account<\/strong>. If you have a <a href=\"\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\">hosting plan<\/a> with MCloud9 you can follow our guide to <a href=\"https:\/\/myportal.mcloud9.com\/knowledgebase\/10\/Accessing-Your-cPanel-Account.html\" target=\"_blank\" rel=\"noreferrer noopener\">accessing your cPanel account<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. <strong>Locate the &#8216;Indexes&#8217; tool<\/strong>. It&#8217;s under the &#8216;Advanced&#8217; section.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c50e7&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c50e7\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"848\" height=\"325\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-Indexes-option.png\" alt=\"Select Indexes option\" class=\"wp-image-3487\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-Indexes-option.png 848w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-Indexes-option-300x115.png 300w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-Indexes-option-768x294.png 768w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-Indexes-option-696x267.png 696w\" sizes=\"auto, (max-width: 848px) 100vw, 848px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Navigate to the directory you wish to secure<\/strong>. This is usually the &#8216;<strong>public_html<\/strong>&#8216; folder (where your website files are stored). Alternatively, you can use the &#8216;File Manager&#8217; to navigate to the directory you want to secure then right-click and choose &#8216;Manage Indices&#8217; (then jump to step 5).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Select the &#8216;Edit&#8217; option<\/strong>.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c54cd&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c54cd\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"66\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-Edit-option.png\" alt=\"Select the 'Edit' option\" class=\"wp-image-3489\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-Edit-option.png 629w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-Edit-option-300x31.png 300w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. Choose &#8216;No Indexing&#8217; then click &#8216;Save&#8217;<\/strong>. This restricts access to the folder, preventing directory browsing.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c588c&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c588c\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"489\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Choose-No-Indexing-and-select-Save.png\" alt=\"Choose 'No Indexing' and select Save\" class=\"wp-image-3482\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Choose-No-Indexing-and-select-Save.png 977w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Choose-No-Indexing-and-select-Save-300x150.png 300w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Choose-No-Indexing-and-select-Save-768x384.png 768w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Choose-No-Indexing-and-select-Save-696x348.png 696w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Choose-No-Indexing-and-select-Save-839x420.png 839w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The other indexing options available include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Inherit<\/strong> is the default set by your hosting provider. It could be on or off.<\/li>\n\n\n\n<li><strong>Show Filename Only<\/strong> allows directory listing. This makes the names of the files and directories visible to the public.<\/li>\n\n\n\n<li><strong>Show Filename and Description<\/strong> also allows directory listing, but a public user can see the file names and directories as well as file attributes: file size and file type.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">By following these simple steps, you&#8217;ve effectively barred unauthorised access to your directories, ensuring your content remains exclusively for your eyes or those you grant permission to.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"option-2-disabling-directory-browsing-in-c-panels-file-manager\">Option 2: Disabling Directory Browsing in cPanel&#8217;s File Manager<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine the File Manager as your website&#8217;s backstage, where you manage files and folders. Here\u2019s how you can disable directory browsing:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Log in to your cPanel account<\/strong>. Learn how to <a href=\"https:\/\/myportal.mcloud9.com\/knowledgebase\/10\/Accessing-Your-cPanel-Account.html\" target=\"_blank\" rel=\"noreferrer noopener\">access your MCloud9 cPanel account<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Open the File Manager<\/strong>. It&#8217;s usually under the &#8216;Files&#8217; section.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c5da9&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c5da9\" class=\"wp-block-image size-full is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"273\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool.png\" alt=\"Select the cPanel 'File Manager' tool\" class=\"wp-image-3488\" style=\"width:696px;height:auto\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool.png 816w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool-300x100.png 300w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool-768x257.png 768w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool-696x233.png 696w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Navigate to the &#8216;public_html&#8217; directory<\/strong> (this is where your website files are stored).<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c614a&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c614a\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"175\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Navigate-to-the-public_html-folder.png\" alt=\"Navigate to the 'public_html' folder\" class=\"wp-image-3486\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Navigate-to-the-public_html-folder.png 507w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Navigate-to-the-public_html-folder-300x104.png 300w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Find the folder you want to secure<\/strong>. Right-click on it and select &#8216;Change Permissions&#8217;.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c64ef&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c64ef\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"310\" height=\"425\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-folder-then-right-click-and-choose-Change-Permissions.png\" alt=\"Select the folder then right-click and choose 'Change Permissions'\" class=\"wp-image-3490\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-folder-then-right-click-and-choose-Change-Permissions.png 310w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-folder-then-right-click-and-choose-Change-Permissions-219x300.png 219w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-folder-then-right-click-and-choose-Change-Permissions-306x420.png 306w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5. <strong>Set permissions to 750 or 700 and save<\/strong>. After changing the permissions by checking\/unchecking the option boxes, save the changes by selecting the &#8216;<strong>Change Permissions<\/strong>&#8216; button. <\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c69fb&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c69fb\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"506\" height=\"324\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Change-permissions-and-save.png\" alt=\"Change permissions and save\" class=\"wp-image-3497\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Change-permissions-and-save.png 506w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Change-permissions-and-save-300x192.png 300w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This restricts access to the folder, prohibiting directory browsing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"option-3-manually-creating-index-files-to-prevent-directory-listing\">Option 3: Manually Creating Index Files To Prevent Directory Listing<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Creating index files serves as an added layer of security. Here&#8217;s how you do it:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Open the File Manager in your cPanel dashboard<\/strong>.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c6ccc&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c6ccc\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"273\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool.png\" alt=\"Select the cPanel 'File Manager' tool\" class=\"wp-image-3488\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool.png 816w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool-300x100.png 300w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool-768x257.png 768w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-cPanel-File-Manager-tool-696x233.png 696w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Go to to the folder you want to protect<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Create an index file<\/strong>. You can do this by creating a new index.html or index.php file in the directory or uploading one into the directory.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c707b&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c707b\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"265\" height=\"99\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Create-a-file-in-the-directory.png\" alt=\"Create a file in the directory\" class=\"wp-image-3483\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c73de&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c73de\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"509\" height=\"260\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Name-the-file-index.html-or-index.php-and-save-it.png\" alt=\"Name the file 'index.html' or 'index.php' and save it\" class=\"wp-image-3500\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Name-the-file-index.html-or-index.php-and-save-it.png 509w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2024\/03\/Name-the-file-index.html-or-index.php-and-save-it-300x153.png 300w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Ensure the file is empty or has a redirect<\/strong>. This file will now be the default page people see, securing your directory contents from prying eyes.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. (Optional) Edit the Index File<\/strong>: You can display a custom message to visitors when trying to access the folder. Simply right-click on the newly created\/uploaded file and select &#8216;Edit.&#8217; No need to worry; you won&#8217;t need to be a coding whiz. A simple tag like <code>&lt;h1&gt;Access Denied&lt;\/h1&gt;<\/code> will do the trick. Save it, and you&#8217;re done!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Voila! You&#8217;ve placed a digital &#8220;Do Not Disturb&#8221; sign on your directories, effectively deterring unwanted access.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"option-4-configuring-htaccess-to-turn-off-directory-listing\">Option 4: Configuring .htaccess To Turn off Directory Listing<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The steps to disable directory listing through the .htaccess file involve creating or editing the .htaccess file in the root directory of your website and adding the necessary code to forbid directory indexing. This ensures that directory listing is turned off for the entire site or specified directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Go to the File Manager via cPanel<\/strong>. If you host with MCloud9 you can view our easy guide to <a href=\"https:\/\/myportal.mcloud9.com\/knowledgebase\/10\/Accessing-Your-cPanel-Account.html\" target=\"_blank\" rel=\"noreferrer noopener\">accessing your cPanel account<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Browse to the directory you want to secure<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Locate the &#8216;.htaccess&#8217; file, right-click and choose &#8216;Edit.<\/strong>&#8216; If the file doesn\u2019t exist, create one by selecting the &#8216;+ File&#8217; option from the top toolbar (on the right) and naming it &#8216;.htaccess&#8217; (make sure to include the period at the beginning).<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a10d0a2c78f5&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a10d0a2c78f5\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"346\" height=\"378\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-htaccess-file-and-choose-edit.png\" alt=\"\" class=\"wp-image-3491\" srcset=\"https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-htaccess-file-and-choose-edit.png 346w, https:\/\/www.mcloud9.com\/blog\/wp-content\/uploads\/2023\/12\/Select-the-htaccess-file-and-choose-edit-275x300.png 275w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Insert the following code and click &#8216;Save Changes&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Options -Indexes<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This simple line commands the server to disable directory listing for the current directory and all subdirectories.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"checking-directory-listing-status\">Checking Directory Listing Status<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Curious to see if your changes took effect? <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s easy, simply attempt to access a folder that once displayed its directory contents, you should now encounter either a &#8216;<strong>Page Not Found<\/strong>&#8216;, &#8216;<strong>Access Denied<\/strong>&#8216;, or a &#8216;<strong>Forbidden<\/strong>&#8216; error message.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq-for-disabling-directory-listings\">FAQ for Disabling Directory Listings<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1701725120268\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What does it mean to disable directory listing in cPanel?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Disabling directory listing means that when a user goes to a directory on your website where there is no index file (e.g., index.html, index.php), instead of displaying a list of the contents of the directory, a &#8220;forbidden&#8221; or &#8220;not found&#8221; error message will appear.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1701725124245\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">Can I disable directory listing globally for my entire website in cPanel?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes, you can disable directory listing globally for your website by using the .htaccess file. By adding a specific line of code to the .htaccess file, you can turn off directory indexing for the entire website.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1701725131051\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">I am using WordPress, how can I disable directory listing in cPanel?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>If you are using WordPress, you can disable directory listing in <a href=\"\/blog\/what-is-cpanel\">cPanel<\/a> by adding the appropriate code to the .htaccess file. This can be done through the file manager in the cPanel or by using an FTP client to access the files.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1701725155575\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What if I do not have access to the .htaccess file?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>If you don&#8217;t have access to the .htaccess file, you may need to contact your web hosting service provider to apply the necessary changes or utilise the alternative methods mentioned in the article to achieve this.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"in-conclusion\">In Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations! You&#8217;ve taken a significant move in fortifying your website&#8217;s security by learning how to disable directory listing in your cPanel. Now, when visitors try to peek into your website&#8217;s folders, they&#8217;ll encounter an impenetrable fortress rather than an open gateway.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By implementing the steps outlined in this tutorial, you&#8217;ve safeguarded your content from prying eyes, ensuring that only authorised individuals can access specific directories. At <a href=\"\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\">MCloud9<\/a>, we understand the paramount importance of web security in fostering a trustworthy online presence.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For further insights or assistance in <a href=\"\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\">web hosting<\/a>, security, or any other digital endeavours, MCloud9 stands ready as your reliable partner in navigating the complexities of the online realm.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Building your online presence is a thrilling journey, but it&#8217;s vital to keep it secure too. In this article, we&#8217;re diving into a fundamental aspect of website security: how to disable directory listing in your cPanel control panel. Don&#8217;t worry, it&#8217;s not as complex as it sounds, and by the end of this guide, you&#8217;ll [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":3507,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[20,47],"tags":[78,56],"class_list":["post-3479","post","type-post","status-publish","format-standard","has-post-thumbnail","category-security","category-web-hosting","tag-cpanel","tag-cybersecurity"],"_links":{"self":[{"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/posts\/3479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/comments?post=3479"}],"version-history":[{"count":17,"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/posts\/3479\/revisions"}],"predecessor-version":[{"id":4307,"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/posts\/3479\/revisions\/4307"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/media\/3507"}],"wp:attachment":[{"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/media?parent=3479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/categories?post=3479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcloud9.com\/blog\/wp-json\/wp\/v2\/tags?post=3479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}