Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
The Server Admin
The Server Admin
  • Home
  • Linux
  • Windows
  • About
  • What Powers The Server Admin
  • Home
  • Linux
  • Windows
  • About
  • What Powers The Server Admin
Close

Search

  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
Subscribe
Linux

htaccess enable directory listing

By Anthony
July 11, 2025 1 Min Read
0

To enable directory listing for a specific folder on a web server, you can create or edit an .htaccess file within that folder and add the directive Options +Indexes. This tells the server to display a list of files and subdirectories when no index file (like index.html or index.php) is present in that directory.
 

Steps to enable directory listing with .htaccess:

  1. Access your server’s file system: You can do this via FTP, a file manager in your hosting control panel (like cPanel), or SSH. 
  2. Locate or create the .htaccess file: Navigate to the directory where you want to enable directory listing. If a .htaccess file doesn’t exist, create a new one with that exact name. 
  3. Add the directive: Open the .htaccess file and add the following line:

Code

    Options +Indexes

Note: Some hosting providers might have additional settings or require different steps, such as enabling hidden files in the file manager. 

  1. Save and close the file.
  2. Test the directory listing: When you browse to that directory in your web browser, you should now see a list of its contents instead of a 403 Forbidden error.

Important Considerations:

  • Security:Enabling directory listing can expose your files and potentially sensitive information, so use it with caution and only when necessary. 
  • Disabling directory listing:To disable directory listing, you can use Options -Indexes in an .htaccess file within the desired directory. 
  • Subdirectories:Adding Options +Indexes to a .htaccess file will apply to that directory and its subdirectories unless overridden by a .htaccess file in a subdirectory. 

Author

Anthony

Follow Me
Other Articles
Previous

Replace a single string in a large number of files in Unix

Next

Load Balancing with Caddy

Search

Need a Virtual Server for sysctl testing? Check out our plans!

Popular Posts

  • Mount sFTP folder as local drive
    by Anthony
    June 9, 2026
  • Robocopy Examples
    by Anthony
    February 12, 2026
  • Rsync Command Examples
    by Anthony
    February 10, 2026

Trending

  • Mount sFTP folder as local drive
    by Anthony
    June 9, 2026
  • Adding a GUI to a Server or VPS
    by Anthony
    August 27, 2024
  • Back up to a shared folder with Time Machine on Mac
    by Anthony
    January 4, 2025
  • Backup Your Databases
    by Anthony
    March 24, 2024

Editors Picks

    Send an email:
    mail@example.com

    Call me:
    123-456-7890

    • Facebook
    • Twitter
    • Instagram
    • TikTok
    • LinkedIn
    • Behance
    Copyright 2026 — The Server Admin. All rights reserved. Blogsy WordPress Theme