24.6 Directory IndexingThis section discusses the directives used to determine exactly how the server will respond when a user makes a directory request. AddBlankIconAddBlankIcon icon_path Specifies an icon that is the same size as the other directory index icons, but is entirely transparent, i.e., a blank icon. This is used to properly align the column headings with the columns of information in the file listing. AddDirIconAddDirIcon icon_path alt_text Specifies an icon to be used for subdirectories in a file listing. The second argument specifies alternate text for the icon. For example:
AddDirIcon /icons/directory.xbm DIR AddIconAddIcon icon_path alt_text mime_type Specifies an icon and alternate text to be associated with a given MIME type or encoding of a file in a directory listing. For example, to use the icon /icons/compass.gif and the alt text "MAP" for Netcarta webmaps (MIME type application/webmap), use the following setting:
AddIcon /icons/compass.gif MAP application /webmap The CERN server does have some default icon mappings (and includes the icons with the server distribution), but these are all wiped out if you use AddIcon directives to add mappings of your own. AddIconToStdAddIconToStd icon_path alt_text mime_type The AddIconToStd directive acts just like AddIcon, except that your icons augment the mapping list rather than replace it. AddParentIconAddParentIcon icon_path alt_text The AddParentIcon directive specifies an icon and alt text for the parent directory ("..") in a directory listing. For example:
AddParentIcon /icons/back.xbm UP AddUnknownIconAddUnknownIcon icon_path The AddUnknownIcon directive specifies an icon to be used for files of unknown type or encoding. AlwaysWelcomeAlwaysWelcome On|Off Specifies whether requesting a directory without its trailing slash returns a directory listing or a "welcome" document (see the Welcome directive). The default is On, in which case the "welcome" document is returned whether or not the trailing slash is included. DirAccessDirAccess On|Off|Selective Specifies whether, and under what conditions, the server should generate its own directory indices. Options are:
DirAddHrefDirAddHref filename suffix Links a resource to the icon of specified file types in a file listing. For example, you could have an icon reference a CGI script on your server that could unpack the contents of a listed tar file and return a listing of the archive:
DirAddHref /cgi-bin/untar .tar DirReadmeDirReadme Top|Bottom|None When a directory index is generated, the server looks in the directory being indexed for a file named README. If this file exists, its contents are included in the directory index as an explanation of the contents of the directory. The DirReadMe directive specifies if and where this file should be included. Values are:
DirShowBracketsDirShowBrackets On|Off Specifies whether alternate text of MIME type descriptions will have square brackets around them. The default setting is:
DirShowBrackets On which means the descriptions will be placed within brackets. If icons are not included, this directive has no effect. DirShowBytesDirShowBytes On|Off Specifies whether file size should be shown in a file listing when sizes are turned on with DirShowSize. DirShowCaseDirShowCase On|Off Determines whether the server notices case when ordering the files for the listing. If case is noticed, then all files with uppercase names will be listed before their lowercase neighbors (i.e., normal ls order). If case is not noticed, upper- and lowercase names will be interleaved. The default setting is Off. DirShowDateDirShowDate On|Off Specifies whether the last-modified time should be included for each file. DirShowDescriptionDirShowDescription should Specifies whether a description of the file should be shown in a directory listing. The server looks for a file named .www_descript in the directory to act as a description database. The format of this database is one entry per line, where an entry consists of the word "DESCRIBE," the filename or template, and the description, with whitespace acting as the delimiter. Here are some example entries:
DESCRIBE techspecs.html technical docs DESCRIBE adcopy.html advertising copy DirShowGroupDirShowGroup On|Off Specifies whether the group of the file should be included. The group name is used if it is available; otherwise, the group id is used. The default is Off. DirShowHiddenDirShowHidden On|Off Specifies whether hidden files (i.e., those whose names begin with ".") should be included in the file listing. The default is Off. DirShowIconsDirShowIcons On|Off Specifies whether icons indicating the MIME types of the files should be included on each line. The default is On. DirShowMaxDes...DirShowMaxDescrLength length If descriptions of the files in a listing are shown, the length of the description is determined by the number of characters specified with the DirShowMaxDescrLength directive. The default is 25. DirShowMaxLengthDirShowMaxLength length Specifies the maximum number of characters used for filenames in a listing. The file listing will always use at least the minimum number of characters (from DirShowMinLength), but will never show more than the maximum, truncating filenames that are too long. The default is 25. DirShowMinLengthlength The Specifies the minimum number of characters used for filenames in a listing. The default is 15. DirShowModeDirShowMode On|Off Specifies whether permissions of the file should be included. The mode is written in mnemonic form, such as "rw-rw-rw-", rather than numeric form, such as "666". The default is Off. DirShowOwnerDirShowOwner On|Off Specifies whether the owner of the file should be included in the directory listing. The user name is used if it is available; otherwise, the user id is used. The default is Off. DirShowSizeDirShowSize On|Off Specifies whether the size should be included for each file in a listing. The default is On. IconPathIconPath prefix Specifies a server path prefix to be attached to all icon paths. For example, for the Add*Icon directives, the /icons/ part of the filenames could have been left off the icon path by adding the following line before them in the configuration file:
IconPath /icons/ Remember that this will be prefixed to every path, so only use it if you are sure that you will put all of your icons within a single directory or tree. WelcomeWelcome filename Specifies the name of the file in a directory to use when a directory is requested rather than a specific document. If multiple Welcome directives are specified, they are searched for in order, and the first one located is returned. By default, the files are Welcome.html, welcome.html, and index.html. |
|