loading

How do I disable directory listing in cPanel?

Updated at
26/01/2023
Views
8336

To disable directory listing in cPanel, you can use the .htaccess file. Here are the steps to follow:

  1. Log in to your cPanel account.
  2. In the Files section, click on the "File Manager" icon.
  3. Locate the .htaccess file in the public_html directory. If you do not see the file, make sure that "Show Hidden Files" is enabled in the settings.
  4. Right-click on the .htaccess file and select "Code Edit" or "Edit".
  5. Add the following line to the file: Options -Indexes
  6. Save the changes and close the editor.

This will disable directory listing for the entire website. If you want to disable directory listing for a specific directory, you can create a new .htaccess file in that directory and add the same line.

Alternatively, you can also disable directory listing by adding the following line to the Apache config file,

<Directory /path/to/directory> Options -Indexes </Directory>

Please note that disabling directory listing can help to improve the security of your website by preventing people from easily browsing the contents of your directories. However, it may also prevent some legitimate uses of your website, so it's important to test your website after making this change.

YottaSrc footer

why choose us?

Better Pricing, Fast SSD Storage and Real 24/7
Technical Support.

control panel icon
cPanel

Managing Your Site Through CPanel With The Latest Version

security icon
FAST, RELIABLE & SECURE

99.8% Uptime Guarantee.
So Focus On Your Work!

support icon
24/7/365 Support

Day or night, rain or shine,
our team is here for you!

cloud backup icon
Daily Backup

Daily & Weekly Backup.
Your Files Are Safe!