Server Administration & Management

How to Enable/Disable Directory Listing in .htaccess

If you want list all the file that are present under certain directory then you will need to enabled directory listing that be be done in your .htaccess file as fallows.

1) Edit your .htaccess file and put following code

Options +Indexes

2) save and exit. Now you are done.
Eg: http://yourdomain.com/test

All files under test directory will be listed into browser.

If you want to disable it then enter following line in .htaccess

Options -Indexes

February 3, 2011 Posted by | Apache, htaccess | , , | Leave a comment