Dressing Up Your Directory Listings

Ran across an Apache feature by accident today. I had uploaded some files to a (Linux) server and browsed to that directory. Since there was no directory index (index.php, index.html, etc.) the browser showed a directory listing. Oddly, though, below the listing were the contents of the README.html in that directory:

Directory Listing

Seems that Apache—the web server software powering most of the Web—has an optional feature that allows the webmaster to specify a file that will be appended to directory listings. By default, that file is named README.html. Additionally, a file named HEADER.html is prepended to directory listings.

In many cases you probably don't want your directories to be listed. But if you have a use for them, these two files (which must exist in the directory and must be named exactly as specified by the Apache configuration file) can help you dress up those directory listings.