Summary
The module mod_dir provides "trailing slash" redirects and serving directory index files. The index of a directory can come from one of two sources:
The two functions are separated so you can completely remove (or replace) automatic index generation.
By default, a trailing slash ('/') redirect is issued when the server receives a request for a URL http://servername/QIBM/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/QIBM/dirname/.
The AlwaysDirectoryIndex directive controls how the server will respond to directory requests.
Directives
Module: mod_dir | |
Syntax: AlwaysDirectoryIndex on | off | |
Default: Always DirectoryIndex on | |
Context: server config, virtual host, directory, .htaccess | |
Override: Indexes | |
Origin: iSeries™ | |
Example: AlwaysDirectoryIndex off |
The AlwaysDirectoryIndex directive specifies if you want the server to always handle directory requests by first searching the directory for an index (Welcome) file.
If the server does not find an index file, or AlwaysWelcome is set to off and the directory request does not end in a slash, Options controls whether or not the server responds to the request with a directory listing.
Module: mod_dir | |
Syntax: DirectoryIndex local-url [local-URL ...] | |
Default: DirectoryIndex index.html | |
Context: server config, virtual host, directory, .htaccess | |
Override: Indexes | |
Origin: Apache | |
Example: DirectoryIndex bob.html index.html |
The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the a directory name. Local-URL is the (%-encoded) URL of a document on the server relative to the requested directory; it is usually the name of a file in the directory. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.
DirectoryIndex index.html
A request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or it would list the directory if it did not exist.
The documents do not need to be relative to the directory. For example:
DirectoryIndex index.html index.txt /cgi-bin/index.pl
This would cause the CGI script /cgi-bin/index.pl to be run if neither index.html or index.txt existed in a directory. This same idea will also work for QSYS.LIB files. For example, if the directory index is stored in /QSYS.LIB/MYLIB.LIB/MYFILE.FILE/INDEX.MBR, you would need to specify DirectoryIndex Index.mbr.
This directive may be configured multiple times in a container. The directives are processed from the first to the last occurrence.