Disabling Directory Indexing

From OCS Support Wiki

Jump to: navigation, search

[edit] Introduction

By default, Apache will show a directory listing of a folder that does not have an index.html, index.php, or default.htm file. This behavior is desired in most circumstances, but not in others.

[edit] Disabling Indexing

You can disable indexing for a particular folder by putting the below code in an .htaccess file (or adding this to your .htaccess file):

Options -Indexes

This will disable indexing for the folder that contains the .htaccess and all folders below it. To disable it on your entire site, put this in your public_html folder.