Summary
The module mod_autoindex provides for automatic directory indexing. The index of a directory can come from one of two sources:
If the FancyIndexing keyword is present on the IndexOptions directive, the column headers are links that control the order of the display. If you select a header link, the listing will be regenerated, sorted by the values in that column. Selecting the same header repeatedly toggles between ascending and descending order.
For all mod_autoindex directives that specify a file name (AddDescription, AddIcon, and so on), case sensitivity is handled based on the file system. If the object is in the QOpenSys file system, the name is handled in a case sensitive manner. If the object is a file system other than QOpenSys, the name is handled in a case insensitive manner.
Directives
Module: mod_autoindex | |
Syntax: AddAlt string file [file...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: AddAlt "IMG" jpg gif |
The AddAlt directive sets the alternate text to display for automatic directory indexing.
AddAlt "IMG" .jpg .gif AddAlt " " ^^BLANKICON^^ AddAlt "BAK" *~
Module: mod_autoindex | |
Syntax: AddAltByEncoding string MIME-encoding [MIME-encoding...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: AddAltByEncoding "CMP" x-compress |
The AddAltByEncoding directive sets the alternate text to display for a file, instead of an icon, for automatic directory indexing.
Module: mod_autoindex | |
Syntax: AddAltByType string MIME-type [MIME-type ...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: AddAltByType "HTM" text/html |
The AddAltByType directive sets the alternate text to display for a file, instead of an icon, for automatic directory indexing.
Module: mod_autoindex | |
Syntax: AddDescription string file [file...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: AddDescription "Famous People" /web/pics/famous* | |
Example: AddDescription "My pictures" /QSYS.LIB/MYLIB/MYFILE.FILE/pic* |
The AddDescription directive sets the description to display for a file, for automatic directory indexing. File is a file extension, partial filename, QSYS.LIB member type, wildcard expression or full filename for files to describe. String is enclosed in double quotes ("). For example:
AddDescription "The planet Mars" /web/pics/mars.gif
By default, the description field is 23 bytes wide. Seven more bytes may be added if the directory is covered by an IndexOptions SuppressSize, and 19 bytes may be added if IndexOptions SuppressLastModified is in effect. The widest this column can be is therefore 49 bytes, unless configured differently using IndexOptions DescriptionMaxWidth.
The DescriptionWidth IndexOptions keyword allows you to adjust this width to any arbitrary size.
The following order of precedence will be used to search for a directory listing file description. The first mechanism from this list that applies will be used to generate the file description:
Module: mod_autoindex | |
Syntax: AddIcon icon name [name ...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: AddIcon (IMG,icons/image) .gif .jpg |
The AddIcon directive sets the icon to display next to a file ending in name for automatic directory indexing.
AddIcon (IMG,icons/image) .gif .jpg AddIcon (PAR, icons/parent .gif) ^^PARENT^^ AddIcon /dir.gif ^^DIRECTORY^^ AddIcon backup.gif *~
AddIconByType should be used in preference to AddIcon, when possible.
Module: mod_autoindex | |
Syntax: AddIconByEncoding icon MIME-encoding [MIME-encoding ...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: AddIconByEncoding /compress.xbm x-compress |
The AddIConByEncoding directive sets the icon to display next to files with MIME-encoding for automatic directory indexing.
Module: mod_autoindex | |
Syntax: AddIconByType icon MIME-type [MIME-type ...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: AddIconByType (IMG,image.gif) image/* |
The AddIconByType directive sets the icon to display next to files of type MIME-type for FancyIndexing. Icon is either a (%-escaped) relative URL to the icon, or of the format (alttext,url) where alttext is the text tag given for an icon for non-graphical browsers.
Module: mod_autoindex | |
Syntax: DefaultIcon url | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Modified | |
Example: DefaultIcon /icon/unknown.gif |
The DefaultIcon directive sets the icon to display for files when no specific icon is known, for automatic directory indexing.
DefaultIcon (UNK,unknown.gif)
Module: mod_autoindex | |
Syntax: HeaderName filename | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: HeaderName headerfile | |
Example: HeaderName PREAMBLE.MBR |
The HeaderName directive sets the name of the file that will be inserted at the top of the index listing.
Filename is treated as a URI path relative to the one used to access the directory being indexed, and must resolve to a document with a major content type of "text" (for example, text/html, text/plain). This means that filename may refer to a CGI script if the script's actual file type (as opposed to its output) is marked as text/html such as with a directive like:
AddType text/html .cgi
Content negotiation will be performed if the MultiViews option is enabled. See Content negotiation for HTTP Server (powered by Apache) for more information.
If filename resolves to a static text/html document (not a CGI script) and the Includes Option is enabled, the file will be processed for server-side includes. See mod_include for more information.
See also ReadmeName.
Module: mod_autoindex | |
Syntax: IndexIgnore file [file ...] | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: IndexIgnore README .htaccess | |
Example: IndexIgnore README.MBR |
The IndexIgnore directive adds to the list of files to hide when listing a directory. Multiple IndexIgnore directives add to the list, rather than the replacing the list of ignored files. By default, the dot directory (.) is ignored.
Module: mod_autoindex | |
Syntax: IndexOptions [+|-]option [+|-]option ... | |
Default: none | |
Context: server config, virtual host, directory, .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: IndexOptions FancyIndexing ShowOwner FoldersFirst |
The IndexOptions directive specifies the behavior of the directory indexing.
Parameter | Description |
---|---|
DescriptionWidth= [n] |
|
FancyIndexing | This turns on fancy indexing of directories. With FancyIndexing,
the column headers are links that control the order of the display. If you
select a header link, the listing will be regenerated, sorted by the values
in that column. Selecting the same header repeatedly toggles between ascending
and descending order. Note: When the display is sorted by "Size", it is
the actual size of the files that's used, not the displayed value. Regardless
of the ShowSmallFileBytes option setting, a 1010-byte file will always be
displayed before a 1011-byte file (if in ascending order) even though the
size of both files could be displayed as "1K".
|
FoldersFirst | If this option is enabled, subdirectories in a FancyIndexed listing will always appear first, followed by normal files in the directory. The listing is broken into two components, the files and the subdirectories, and each is sorted separately and then displayed (subdirectories-first). For instance, if the sort order is descending by name, and FoldersFirst is enabled, subdirectory Zed will be listed before subdirectory Beta, which will be listed before normal files Gamma and Alpha. This option only has an effect if FancyIndexing is also enabled. |
IconsAreLinks | This makes the icons part of the anchor for the filename, for fancy indexing. |
IconHeight=[pixels] | Presence of this option, when used with IconWidth, will cause the server to include HEIGHT and WIDTH attributes in the IMG tag for the file icon. This allows browser to precalculate the page layout without having to wait until all the images have been loaded. If no value is given for the option, it defaults to the standard height of the icons supplied with HTTP Server software. |
IconWidth=[pixels] | Presence of this option, when used with IconHeight, will cause the server to include HEIGHT and WIDTH attributes in the IMG tag for the file icon. This allows browser to precalculate the page layout without having to wait until all the images have been loaded. If no value is given for the option, it defaults to the standard width of the icons supplied with HTTP Server software. |
IgnoreClient | This option causes mod_autoindex to ignore all query variables from the client, including sort order (implies SuppressColumnSorting). |
NameWidth=[n | *] |
|
NameMinWidth=[n] | The NameMinWidth keyword allows you to specify the minimum width that will always be reserved for the filename column in characters. The default setting is 15. The minimum value allowed is 5. If NameMinWidth is greater than NameWidth, then the filename column will have a length=NameMinWidth. |
ScanHTMLTitles | This enables the extraction of the title from HTML documents for fancy indexing. If the file does not have a description given by AddDescription then HTTP Server will read the document for the value of the TITLE tag. This is CPU and disk intensive. |
SelectiveDirAccess | This option causes the server to return directory listings
only for directories that contain a wwwbrws file. The contents of the wwwbrws
file are not important. The server only checks for its existence. The object
is a member name of an i5/OS™ physical file or a type of object in an integrated
file system directory. For case-sensitive file systems such as /QOpenSys,
the wwwbrws name is lowercase. Note: SelectiveDirAccess is an i5/OS specific option. This specific option works on a per directory basis. You must specify the ± SelectiveDirAccess on a Directory container. |
ShowOwner | This determines whether directory listings should include the owner ID for each file. |
SuppressColumnSorting | If specified, HTTP Server will not make the column headings in a FancyIndexed directory listing into links for sorting. The default behavior is for them to be links; selecting the column heading will sort the directory listing by the values in that column. |
SuppressDescription | This will suppress the file description in fancy indexing listings. See AddDescription for information about setting the file description. See also the DescriptionWidth index option to limit the size of the description column. |
SuppressHTMLPreamble | If the directory actually contains a file specified by the HeaderName directive, the module usually includes the contents of the file after a standard HTML preamble (<HTML>, <HEAD>, and so on). The SuppressHTMLPreamble option disables this behavior, causing the module to start the display with the header file contents. The header file must contain appropriate HTML instructions in this case. If there is no header file, the preamble is generated as usual. |
SuppressIcon | This suppresses the display of icons on directory listings. The default is that no options are enabled. |
SuppressLastModified | This will suppress the display of the last modification date, in fancy indexing listings. |
SuppressRules | This will suppress the horizontal rule lines (HR tags) in directory listings. Combining both SuppressIcon and SuppressRules yields proper HTML 3.2 output, which by the final specification prohibits IMG and HR tags from the PRE block (used to format FancyIndexed listings). |
SuppressSize | This will suppress the file size in fancy indexing listings. |
TrackModified | This returns the Last-Modified and ETag values for the listed directory in the HTTP header. It is only valid if the operating system and file system return appropriate stat() results. Some UNIX® systems do so, as do OS/2's JFS and Win32's NTFS volumes. OS/2® and Win32 FAT volumes, for example, do not. Once this feature is enabled, the client or proxy can track changes to the list of files when they perform a HEAD request. Note some operating systems correctly track new and removed files, but do not track changes for sizes or dates of the files within the directory. Changes to the size or date stamp of an existing file will not update the Last-Modified header on all UNIX platforms. If this is a concern, leave this option disabled. |
VersionSort | The VersionSort keyword causes files containing version
numbers to sort in a natural way. Strings are sorted as usual, except that
substrings of digits in the name and description are compared according to
their numeric value. For example:
|
Notes on IndexOptions directives:
Whenever a '+' or '-' prefixed keyword is encountered, it is applied to the current IndexOptions settings (which may have been inherited from an upper-level directory). However, whenever an non-prefixed keyword is processed, it clears all inherited options and any incremental settings encountered so far. Consider the following example:
IndexOptions +ScanHTMLTitles -IconsAreLinks FancyIndexing IndexOptions +SuppressSize
The net effect is equivalent to IndexOptions FancyIndexing +SuppressSize, because the non-prefixed FancyIndexing discarded the incremental keywords before it, but allowed them to start accumulating again afterward. To unconditionally set the IndexOptions for a particular directory, clearing the inherited settings, specify keywords without either '+' or '-' prefixes.
Module: mod_autoindex | |
Syntax: IndexOrderDefault [ ascending | descending ] [ name | date | size | owner | description ] [ CaseSense | NoCaseSense ] | |
Default: IndexOrderDefault Ascending Name CaseSense | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Modified | |
Example: IndexOrderDefault descending size |
The IndexOrderDefault directive is used in combination with the FancyIndexing index option. By default, FancyIndexed directory listings are displayed in ascending order by filename; the IndexOrderDefault allows you to change this initial display order.
IndexOrderDefault takes two required arguments and a third optional argument.
You can force a directory listing to only be displayed in a particular order by combining this directive with the SuppressColumnSorting index option; this will prevent the client from requesting the directory listing in a different order.
Module: mod_autoindex | |
Syntax: ReadmeName filename | |
Default: none | |
Context: server config, virtual host, directory (but not location), .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: ReadMeName readme | |
Example: ReadMeName README.MBR |
The ReadmeName directive sets the name of the file that will be appended to the end of the index listing.