12
Feb
2011

How to enable / disable directory listing

Posted in: Webmaster No Comments

This method applies on Apache / Linux servers. Directory listing will show all folder and files of any directory in a browser if that directory do not have any index.html / index.php file.

You can enable disable directory listing. Simply add below codes in .htaccess file. If you do not have any .htaccess file, create a blank text file and rename it to .htaccess

Disable Directory listing
Copy paste below code in .htaccess file located in public_html folder of your web hosting account.

Options -Indexes

Enable Directory listing
Copy paste below code in .htaccess file located in public_html folder of your web hosting account.

Options +Indexes

Enable Directory listing in Fancy Style
Fancy list including icons, file size, modification date and more. Copy paste below code in .htaccess file located in public_html folder of your web hosting account.

Options +Indexes
IndexOptions +FancyIndexing

You can also use this method for any particular folder or sub-domain name like for www.domain.com/xyz or http://sub.domain.com/

About the Author

Name: Ravi Shekhar
I love learning and sharing web stuffs.

Share this post

Twitter Facebook Google Buzz Digg StumbleUpon Delicious Technorati

Leave a Reply