W3C httpd manual

Directory Browsing

By default references to directories which don't include a welcome page cause httpd to generate a hypertext view of the directory listing. There are numerous configuration directives controlling this feature:

Controlling Directory Browsing

DirAccess On
Enable directory browsing in all directories (which are not forbidden by rules). Synonym with -dy command line option. Default.

DirAccess Off
Disable directory browsing. Synonym with -dn command line option.

DirAccess Selective
Enable selective directory browsing - only directories containing the file .www_browsable are allowed. Synonym with -ds command line option.

README Feature

DirReadme Top
For any browsable directeory containing a README file, include the text at the top of the directory listing. Synonym with -dt command line option. Default.

DirReadme Bottom
Same as previous, but contents of README appear on the bottom. Synonym with -db command line option.

DirReadme Off
Disables the README inclusion feature. Synonym with -dr command line option.


FTPDirInfo Top
FTP messages from FTP servers get placed on top of the FTP directory listing. Default.

FTPDirInfo Bottom
FTP messages go to the bottom of FTP listings.

FTPDirInfo Off
FTP messages are not shown.

Controlling The Look of Directory Listings

The following On/Off directives control how the directory listings look like. The default is to show icons, use brackets around ALTernaltive text, show last-modified, size and description, allow filename field width vary between 15-22 characters, reserve 25 characters for description, and use HTML titles as descriptions for HTML files.

Generate inlined image calls in front of each line. Icons visualize the content-type of the file, and they are defined by AddIcon configuration directive. Default.

Show last modification date. Default.

Show the size of files. Default.

By default files smaller than 1K are shown as just 1K. Setting this directive to On will cause the exact byte count to appear.

Show description if available. Default.

At the time of release of 2.17 there was no consensus about where the descriptions come from, and the mechanism is currently undocumented. For HTML files description it the TITLE element; for other files the description field is left empty.

Scan the first few characters in each HTML file to find the HTML TITLE element, and use that for the description. Default.

The maximum number of characters to show in the description field.

Use brackets around ALTernative text used by browsers not capable of displaying images. Default.

Show hidden Unix files (the ones starting with a dot).

Show the owner of the file.

Show the group of the file.

Show the permissions of files.

Sort entries in a case-sensitive manner, i.e. all capital letters before lower-case letters.


[Version 3.0pre6 and newer] The DirAddHref directive can be used to make the icon in HTTP directory listings sensitive for files which end in specified suffixes. The action is a CGI script call that can produce e.g. a listing of the contents of a tar file.


        DirAddHref  /cgi-bin/unarch  .zip  .tar
This would cause the icon for ZIP and TAR files to be linked to the unarch CGI script (note that this is really a webmaster-supplied CGI script, not the normal unarch program) with the virtual URL path in PATH_INFO environment variable and the physical file path in PATH_TRANSLATED.

WARNING: Don't use this directive on a proxy!

Filename Length

There is a minimum and maximum width for the filename field. Entries longer than the maximum value will be truncated. Default values are 15 and 25, and they can be changed with these directives:
DirShowMinLength num
At least this amount of characters is always reserved for filenames. If the longest filename in the directory is longer than num the field will be extended, but no more than the maximum limit (see next directive).

DirShowMaxLength num
Filenames longer than num will be truncated to fit in length.


The default values would be set by saying:
        DirShowMinLength  15
        DirShowMaxLength  25

httpd@w3.org, July 1995