• Go To Website
  • Go To Website
home/Knowledge Base/cPanel/How to disable directory listing using .htaccess
Popular Search:Reseller Hosting, VPS Hosting, Professional Mail

How to disable directory listing using .htaccess

Updated on April 8, 2022

 

In this article, we’ll describe how to disable directory listing using .htaccess file.

Directory listing allows all your website visitors to get a complete listing of all the important files and folders in your site simply by typing “http://example.com/yourdir” in the browser. This is very dangerous as it gives outsiders access to the core files in your site. We can be easily prevent this by creating a custom .htaccess file in the root directory of your site.

Quick Steps

  • Go to your cPanel account open File Manager.

 

  • Click on Settings, check the box “Show hidden files” and click Save.

 

  • Open the .htaccess file and add the code “Options All –Indexes”.

 

  • Click on “Save Changes” to save and close the file.

 

Login into your cPanel account and select File Manager from the Files section.

cPanel landing page.

 

Locate the .htaccess file in the File Manager. The .htaccess file should be located in your public_html directory. If you can’t find it, then check if Show Hidden Files is enabled in your File Manager settings:

 

Creating a new .htaccess file.

 

If you still can’t find it, then create a new .htaccess file by clicking the File section on the top left corner of your File Manager

Select your .htaccess file and click on the Edit option from the dashboard.

 

Editing the .htaccess file.

 

 

 

Add the code “Options All –Indexes” and click Save Changes.

Editing the .htaccess file.

 

Conclusion

The directing listing on your site has been successfully disabled.

If the steps above listed in this article do not resolve your issue, please feel free to open a support ticket and we’d be happy to take a look.

 

Was this helpful?

Yes  No
Related Articles
  • Using NodeJS Apps
  • How To Setup Node.js App in cPanel
  • How to change cPanel password from your Client Area
  • How to Restore backup using JetBackup5
  • How To Clone A Website In cPanel
  • Setting up DNS records for your domain in CloudFlare
Leave A Comment

You must be logged in to post a comment.

cPanel
  • How to disable directory listing using .htaccess
  • Using NodeJS Apps
  • How To Setup Node.js App in cPanel
  • How to change cPanel password from your Client Area
  • How to Restore backup using JetBackup5
  • How To Clone A Website In cPanel
View All 92  
Popular Articles
  • How to install FREE SSL on cPanel
  • How to Install WordPress Online Using Softaculous App Installer
  • How to register a domain, transfer a domain and buy Hosting Plan
  • Listed Hosting Nameservers
  • Enable or Disable PHP’s GD Extension in cPanel
Categories
  • Email
  • Domain
    • Transfer
  • SSD Hosting
  • Nameservers
  • Cloud VPS
  • PHP
  • Migration
  • Resellers
    • WHMCS
    • WHM
  • Security
    • SSL
  • Professional Business Mail
  • Affliates
  • Dedicated Servers
  • Billings & Payments
  • DNS
  • Files & Access
  • Cloudflare
  • cPanel
    • Softaculous
  • Backup
  • Node.js
  • General
  • Databases
  • WordPress

  How to fix 500 internal server error in wordpress

How to create new folders and files in cPanel  

  • © 2020 - 2024. Listed Hosting. All Rights Reserved.

Popular Search:Reseller Hosting, VPS Hosting, Professional Mail