cPanel is a widely used web hosting control panel that offers a plethora of features for managing websites and servers. One crucial aspect of website security is preventing directory listing, which can expose sensitive information to potential threats. Fortunately, cPanel provides users with the means to disable directory listing easily, thereby enhancing website security. In this guide, we’ll delve into the steps required to disable directory listing in cPanel effectively.
Directory Listing
Directory listing, also known as directory browsing or indexing, allows users to view the contents of a directory on a web server when an index file, such as index.html or index.php, is not present. While directory listing may be convenient for users to navigate through a website’s directory structure, it can pose a security risk by exposing sensitive files and directories to unauthorized access.
Disabling Directory Listing in cPanel:
Disabling directory listing in cPanel can be accomplished using either the cPanel dashboard or File Manager. Below, we’ll outline both methods:
Disable Directory Listing From cPanel Dashboard
1. Log in to your cPanel account using your credentials.
2. Under the Advanced section, click on the Indexes
3. Find the directory or folder that you want to disable and click Select button.
4. Select No Indexing and click Save.
You are done.
You can also follow the below method.
Disable Directory Listing From File Manager
1. Log in to your cPanel account using your credentials.
2. Navigate to the Files section and click on File Manager.
3. Select the directory or folder you want to disable indexing. Write click and select Manage Indices.
4. Select No Indexing and click Save.
This is how we can disable directory listing in cPanel.
Verification
Once you have disabled directory listing using either of the methods mentioned above, it’s essential to verify that the changes have taken effect. You can do so by attempting to access a directory on your website for which directory listing was previously enabled. If done correctly, you should receive a “403 Forbidden” error message, indicating that directory listing has been disabled successfully.