X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=docs%2Fmanual%2Fmod%2Fmod_autoindex.html.en;h=0e7634944ead467c7203ae0afecd8bb183e4f275;hb=0ae5b1af6b6bf3048d2a124e84905f63d6507dea;hp=018a7056e0f4db84d7f900fcee7528f814e3ab1a;hpb=36d32b499809304858c8db725a954d5938823048;p=apache diff --git a/docs/manual/mod/mod_autoindex.html.en b/docs/manual/mod/mod_autoindex.html.en index 018a7056e0..0e7634944e 100644 --- a/docs/manual/mod/mod_autoindex.html.en +++ b/docs/manual/mod/mod_autoindex.html.en @@ -1,23 +1,28 @@ - -mod_autoindex - Apache HTTP Server +mod_autoindex - Apache HTTP Server Version 2.5 - + + + + +

Apache HTTP Server Version 2.5

+
<-
-Apache > HTTP Server > Documentation > Version 2.3 > Modules
+Apache > HTTP Server > Documentation > Version 2.5 > Modules

Apache Module mod_autoindex

@@ -39,9 +44,9 @@ sources:

    -
  • A file written by the user, typically called +
  • A file located in that directory, typically called index.html. The DirectoryIndex directive sets the - name of this file. This is controlled by + name of the file or files to be used. This is controlled by mod_dir.
  • Otherwise, a listing generated by the server. The other @@ -68,7 +73,8 @@ same header repeatedly toggles between ascending and descending order. These column header links are suppressed with the IndexOptions directive's - SuppressColumnSorting option.

    + SuppressColumnSorting + option.

    Note that when the display is sorted by "Size", it's the actual size of the files that's used, not the @@ -76,7 +82,10 @@ before a 1011-byte file (if in ascending order) even though they both are shown as "1K".

-
top

Autoindex Request Query Arguments

-

Apache 2.0.23 reorganized the Query Arguments for Column - Sorting, and introduced an entire group of new query options. - To effectively eliminate all client control over the output, - the IndexOptions - IgnoreClient option was introduced.

+

Various query string arguments are available to give the client + some control over the ordering of the directory listing, as well as + what files are listed. If you do not wish to give the client this + control, the IndexOptions + IgnoreClient option disables that functionality.

The column sorting headers themselves are self-referencing hyperlinks that add the sort query options shown below. Any @@ -220,10 +229,9 @@ icon selected by filename is displayed if the client is image-incapable, has image loading disabled, or fails to retrieve the icon.

-

Examples

- AddAlt "PDF file" *.pdf
- AddAlt Compressed *.gz *.zip *.Z -

+
AddAlt "PDF file" *.pdf
+AddAlt Compressed *.gz *.zip *.Z
+
top
@@ -246,9 +254,8 @@ selected by MIME-encoding This alternate text is displayed if the client is image-incapable, has image loading disabled, or fails to retrieve the icon.

-

Example

- AddAltByEncoding gzip x-gzip -

+
AddAltByEncoding gzip x-gzip
+
top
@@ -271,9 +278,8 @@ icon selected by MIME content-type This alternate text is displayed if the client is image-incapable, has image loading disabled, or fails to retrieve the icon.

-

Example

- AddAltByType 'plain text' text/plain -

+
AddAltByType 'plain text' text/plain
+
top
@@ -292,9 +298,9 @@ icon selected by MIME content-type expression or full filename for files to describe. String is enclosed in double quotes (").

-

Example

- AddDescription "The planet Mars" /web/pics/mars.gif -

+
AddDescription "The planet Mars" mars.gif
+AddDescription "My friend Marshall" friends/mars.gif
+

The typical, default description field is 23 bytes wide. 6 more bytes are added by the IndexOptions SuppressIcon option, 7 bytes are @@ -303,6 +309,15 @@ icon selected by MIME content-type Therefore, the widest default the description column is ever assigned is 55 bytes.

+

Since the File argument may be a partial file name, + please remember that a too-short partial filename may match + unintended files. For example, le.html will match the + file le.html but will also match the file + example.html. In the event that there may be ambiguity, + use as complete a filename as you can, but keep in mind that the + first match encountered will be used, and order your list of + AddDescription directives accordingly.

+

See the DescriptionWidth IndexOptions keyword for details on overriding the size of this column, or allowing descriptions of unlimited length.

@@ -314,6 +329,14 @@ icon selected by MIME content-type results may affect the rest of the directory listing.

+

Arguments with path information

+

Absolute paths are not currently supported and do not match + anything at runtime. Arguments with relative path information, + which would normally only be used in htaccess context, are implicitly + prefixed with '*/' to avoid matching partial directory names.

+
+ +
top

AddIcon Directive

@@ -328,7 +351,7 @@ icon selected by MIME content-type

This sets the icon to display next to a file ending in name for FancyIndexing. Icon is either a (%-escaped) - relative URL to the icon, or of the format + relative URL to the icon, a fully qualified remote URL, or of the format (alttext,url) where alttext is the text tag given for an icon for non-graphical browsers.

@@ -337,11 +360,15 @@ icon selected by MIME content-type correctly), a file extension, a wildcard expression, a partial filename or a complete filename.

-

Examples

- AddIcon (IMG,/icons/image.xbm) .gif .jpg .xbm
- AddIcon /icons/dir.xbm ^^DIRECTORY^^
- AddIcon /icons/backup.xbm *~ -

+

^^BLANKICON^^ is only used for formatting, and so + is unnecessary if you're using IndexOptions + HTMLTable.

+ +
#Examples
+AddIcon (IMG,/icons/image.png) .gif .jpg .png
+AddIcon /icons/dir.png ^^DIRECTORY^^
+AddIcon /icons/backup.png *~
+

AddIconByType should be used in preference to AddIcon, @@ -362,6 +389,7 @@ content-encoding

This sets the icon to display next to files with FancyIndexing. Icon is either a (%-escaped) relative URL to the icon, + a fully qualified remote URL, or of the format (alttext,url) where alttext is the text tag given for an icon for non-graphical browsers.

@@ -369,9 +397,8 @@ content-encoding

MIME-encoding is a valid content-encoding, such as x-compress.

-

Example

- AddIconByEncoding /icons/compress.xbm x-compress -

+
AddIconByEncoding /icons/compress.png x-compress
+
top
@@ -389,6 +416,7 @@ content-type

This sets the icon to display next to files of type MIME-type for FancyIndexing. Icon is either a (%-escaped) relative URL to the icon, + a fully qualified remote URL, or of the format (alttext,url) where alttext is the text tag given for an icon for non-graphical browsers.

@@ -396,9 +424,8 @@ content-type

MIME-type is a wildcard expression matching required the mime types.

-

Example

- AddIconByType (IMG,/icons/image.xbm) image/* -

+
AddIconByType (IMG,/icons/image.png) image/*
+
top
@@ -414,11 +441,11 @@ configured

The DefaultIcon directive sets the icon to display for files when no specific icon is known, for FancyIndexing. - Url-path is a (%-escaped) relative URL to the icon.

+ Url-path is a (%-escaped) relative URL to the icon, + or a fully qualified remote URL.

+ +
DefaultIcon /icon/unknown.png
-

Example

- DefaultIcon /icon/unknown.xbm -

top
@@ -436,9 +463,8 @@ of the index listing of the file that will be inserted at the top of the index listing. Filename is the name of the file to include.

-

Example

- HeaderName HEADER.html -

+
HeaderName HEADER.html
+

Both HeaderName and ReadmeName now treat @@ -446,9 +472,8 @@ of the index listing access the directory being indexed. If Filename begins with a slash, it will be taken to be relative to the DocumentRoot.

-

Example

- HeaderName /include/HEADER.html -

+
HeaderName /include/HEADER.html
+

Filename must resolve to a document with a major content type of text/* (e.g., @@ -457,9 +482,8 @@ of the index listing actual file type (as opposed to its output) is marked as text/html such as with a directive like:

-

- AddType text/html .cgi -

+
AddType text/html .cgi
+

Content negotiation will be performed if Options @@ -477,6 +501,10 @@ of the index listing +SuppressHTMLPreamble, so that these tags are not repeated.

+

See also

+
top

IndexHeadInsert Directive

@@ -491,10 +519,8 @@ of the index listing

The IndexHeadInsert directive specifies a string to insert in the <head> section of the HTML generated for the index page.

-

Example

- - IndexHeadInsert "<link rel=\"sitemap\" href=\"/sitemap.html\">" -

+
IndexHeadInsert "<link rel=\"sitemap\" href=\"/sitemap.html\">"
+
top
@@ -503,6 +529,7 @@ of the index listing Description:Adds to the list of files to hide when listing a directory Syntax:IndexIgnore file [file] ... +Default:IndexIgnore "." Context:server config, virtual host, directory, .htaccess Override:Indexes Status:Base @@ -512,13 +539,48 @@ a directory list of files to hide when listing a directory. File is a shell-style wildcard expression or full filename. Multiple IndexIgnore directives add - to the list, rather than the replacing the list of ignored + to the list, rather than replacing the list of ignored files. By default, the list contains . (the current directory).

-

- IndexIgnore README .htaccess *.bak *~ -

+
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
+ + +

Regular Expressions

+

This directive does not currently work in configuration sections + that have regular expression arguments, such as <DirectoryMatch> +

+
+ + +
top
+

IndexIgnoreReset Directive

+ + + + + + + + +
Description:Empties the list of files to hide when listing +a directory
Syntax:IndexIgnoreReset ON|OFF
Context:server config, virtual host, directory, .htaccess
Override:Indexes
Status:Base
Module:mod_autoindex
Compatibility:2.3.10 and later
+

The IndexIgnoreReset directive removes + any files ignored by IndexIgnore otherwise + inherited from other configuration sections.

+ +
<Directory "/var/www">
+    IndexIgnore *.bak .??* *~ *# HEADER* README* RCS CVS *,v *,t
+</Directory>
+<Directory "/var/www/backups">
+    IndexIgnoreReset ON
+    IndexIgnore .??* *# HEADER* README* RCS CVS *,v *,t
+</Directory>
+ + +

Review the default configuration for a list of + patterns that you might want to explicitly ignore after using this + directive.

top
@@ -528,6 +590,7 @@ a directory indexing Syntax:IndexOptions [+|-]option [[+|-]option] ... +Default:By default, no options are enabled. Context:server config, virtual host, directory, .htaccess Override:Indexes Status:Base @@ -538,58 +601,57 @@ indexing of

-
Charset=character-set (Apache 2.0.61 and +
AddAltClass
+
Adds an additional CSS class declaration to each row of the + directory listing table when IndexOptions HTMLTable + is in effect and an IndexStyleSheet is defined. + Rather than the standard even and odd + classes that would otherwise be applied to each row of the table, + a class of even-ALT or + odd-ALT where ALT is either the + standard alt text associated with the file style (eg. snd, + txt, img, etc) or the alt text defined by one of + the various AddAlt* directives. +
+ +
Charset=character-set (Apache HTTP Server 2.0.61 and later)
The Charset keyword allows you to specify the character set of the generated page. The - default is either ISO-8859-1 or UTF-8, - depending on whether the underlying file system is unicode - or not. + default is UTF-8 on Windows and Mac OS X, + and ISO-8859-1 elsewhere. + (It depends on whether the underlying file system + uses Unicode filenames or not.) -

Example:

- IndexOptions Charset=UTF-8 -

-
+
IndexOptions Charset=UTF-8
-
Type=MIME content-type (Apache 2.0.61 and - later)
- -
The Type keyword allows you to - specify the MIME content-type of the generated page. The default - is text/html. - -

Example:

- IndexOptions Type=text/plain -

-
DescriptionWidth=[n | *] (Apache 2.0.23 and - later)
+
DescriptionWidth=[n | *]
The DescriptionWidth keyword allows you to specify the width of the description column in characters.
-
-DescriptionWidth (or unset) allows - mod_autoindex to calculate the best width.
+
-DescriptionWidth (or unset) allows + mod_autoindex to calculate the best width.
DescriptionWidth=n fixes the column width to n bytes wide.
DescriptionWidth=* grows the column to the width necessary to accommodate the longest description - string.
+ string. -
See the section on AddDescription for dangers + See the section on AddDescription for dangers inherent in truncating descriptions.
FancyIndexing
This turns on fancy indexing of directories.
-
FoldersFirst (Apache - 2.0.23 and later)
+
FoldersFirst
If this option is enabled, subdirectory listings will always appear first, followed by normal files in the @@ -600,18 +662,18 @@ indexing 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.
+ Gamma and Alpha. + This option only has an effect if FancyIndexing + is also enabled. + -
HTMLTable (Experimental, - Apache 2.0.23 and later)
+
HTMLTable
-
This experimental option with FancyIndexing constructs - a simple table for the fancy directory listing. Note this will - confuse older browsers. It is particularly necessary if file +
This option with FancyIndexing constructs + a simple table for the fancy directory listing. + It is necessary for utf-8 enabled platforms or if file names or description text will alternate between - left-to-right and right-to-left reading order, as can happen - on WinNT or other utf-8 enabled platforms.
+ left-to-right and right-to-left reading order.
IconsAreLinks
@@ -626,7 +688,12 @@ indexing 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 the Apache software. + with the Apache httpd software. + + This option + only has an effect if FancyIndexing is also enabled. + +
IconWidth[=pixels]
@@ -636,7 +703,7 @@ indexing 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 the Apache + the standard width of the icons supplied with the Apache httpd software.
IgnoreCase
@@ -659,7 +726,8 @@ indexing
The NameWidth keyword allows you to specify the width of the filename column in bytes.
-
-NameWidth (or unset) allows mod_autoindex to calculate the best width.
+
-NameWidth (or unset) allows mod_autoindex to calculate the best width, but only up + to 20 bytes wide.
NameWidth=n fixes the column width to n bytes wide.
@@ -677,20 +745,19 @@ indexing
ShowForbidden
-
If specified, Apache will show files normally hidden because +
If specified, Apache httpd will show files normally hidden because the subrequest returned HTTP_UNAUTHORIZED or HTTP_FORBIDDEN
SuppressColumnSorting
-
If specified, Apache will not make the column headings in a +
If specified, Apache httpd 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. Prior to Apache 2.0.23, this also - disabled parsing the Query Arguments for the sort - string. That behavior is now controlled by IndexOptions - IgnoreClient in Apache 2.0.23.
+ in that column. However, query string arguments which are appended + to the URL will still be honored. That behavior is controlled by IndexOptions + IgnoreClient.
SuppressDescription
@@ -699,7 +766,11 @@ indexing so the use of this option will regain 23 characters of screen space to use for something else. See AddDescription for information about setting the file description. See also the DescriptionWidth - index option to limit the size of the description column. + index option to limit the size of the description column. + + This option + only has an effect if FancyIndexing is also enabled. +
SuppressHTMLPreamble
@@ -712,10 +783,12 @@ indexing 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. + as usual. If you also specify a ReadmeName, and if that file + exists, The closing </body></html> tags are also + ommitted from the output, under the assumption that you'll likely + put those closing tags in that file. -
SuppressIcon (Apache - 2.0.23 and later)
+
SuppressIcon
This will suppress the icon in fancy indexing listings. Combining both SuppressIcon and @@ -727,24 +800,36 @@ indexing
SuppressLastModified
This will suppress the display of the last modification date, - in fancy indexing listings.
+ in fancy indexing listings. + + This option + only has an effect if FancyIndexing is also enabled. +
SuppressRules - (Apache 2.0.23 and later)
+
This will suppress the horizontal rule lines (hr elements) in directory listings. Combining both SuppressIcon and SuppressRules yields proper HTML 3.2 output, which by the final specification prohibits img and hr elements from the pre block (used to - format FancyIndexed listings.)
+ format FancyIndexed listings.) + + This option + only has an effect if FancyIndexing is also enabled. + +
SuppressSize
-
This will suppress the file size in fancy indexing listings.
+
This will suppress the file size in fancy indexing listings. + + This option + only has an effect if FancyIndexing is also enabled. +
-
TrackModified (Apache - 2.0.23 and later)
+
TrackModified
This returns the Last-Modified and ETag values for the listed directory in the HTTP header. It is only valid @@ -760,8 +845,19 @@ indexing Last-Modified header on all Unix platforms. If this is a concern, leave this option disabled.
+
Type=MIME content-type (Apache HTTP Server 2.0.61 and + later)
+ +
The Type keyword allows you to + specify the MIME content-type of the generated page. The default + is text/html. + +
IndexOptions Type=text/plain
+ +
+
VersionSort - (Apache 2.0a3 and later)
+ (Apache HTTP Server 2.0a3 and later)
The VersionSort keyword causes files containing version numbers to sort in a natural way. Strings are sorted as @@ -789,37 +885,37 @@ indexing
XHTML - (Apache 2.0.49 and later)
+ (Apache HTTP Server 2.0.49 and later)
The XHTML keyword forces mod_autoindex - to emit XHTML 1.0 code instead of HTML 3.2.
+ to emit XHTML 1.0 code instead of HTML 3.2. + This option + only has an effect if FancyIndexing is also enabled. + +
+
Incremental IndexOptions
-

Apache 1.3.3 introduced some significant changes in the - handling of IndexOptions directives. In - particular:

+

Be aware of how multiple IndexOptions are + handled.

  • Multiple IndexOptions directives for a single directory are now merged together. The result of: -

    - <Directory /foo> - - IndexOptions HTMLTable
    - IndexOptions SuppressColumnsorting -
    - </Directory> -

    +
    <Directory "/foo">
    +    IndexOptions HTMLTable
    +    IndexOptions SuppressColumnsorting
    +</Directory>
    +

    will be the equivalent of

    -

    - IndexOptions HTMLTable SuppressColumnsorting -

    +
    IndexOptions HTMLTable SuppressColumnsorting
    +
  • The addition of the incremental syntax (i.e., prefixing @@ -833,10 +929,9 @@ indexing clears all inherited options and any incremental settings encountered so far. Consider the following example:

    -

    - IndexOptions +ScanHTMLTitles -IconsAreLinks FancyIndexing
    - IndexOptions +SuppressSize -

    +
    IndexOptions +ScanHTMLTitles -IconsAreLinks FancyIndexing
    +IndexOptions +SuppressSize
    +

    The net effect is equivalent to IndexOptions FancyIndexing +SuppressSize, because the unprefixed FancyIndexing @@ -876,10 +971,12 @@ Name|Date|Size|Description and identifies the primary key. The secondary key is always the ascending filename.

    -

    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.

    +

    You can, if desired, prevent the client from reordering the list + by also adding the SuppressColumnSorting + index option to remove the sort link from the top of the column, + along with the IgnoreClient index + option to prevent them from manually adding sort options to the + query string in order to override your ordering preferences.

    top
    @@ -895,16 +992,26 @@ Name|Date|Size|Description

    The IndexStyleSheet directive sets the name of the file that will be used as the CSS for the index listing.

    -

    Example

    - - IndexStyleSheet "/css/style.css" -

    +
    IndexStyleSheet "/css/style.css"
    +

    Using this directive in conjunction with IndexOptions - HTMLTable also adds ai-tr-odd and - ai-tr-even class declarations to alternating rows of - the directory listing table, so that you can style alternate rows of - the table differently.

    + HTMLTable adds a number of CSS classes to the resulting HTML. + The entire table is given a CSS id of indexlist and the + following classes are associated with the various parts of the + listing:

    + + + + + + + + + + +
    ClassDefinition
    tr.indexheadHeader row of listing
    th.indexcolicon and td.indexcolicon Icon column
    th.indexcolname and td.indexcolname File name column
    th.indexcollastmod and td.indexcollastmod Last modified column
    th.indexcolsize and td.indexcolsize File size column
    th.indexcoldesc and td.indexcoldesc Description column
    tr.breakrow Horizontal rule at the bottom of the table
    tr.odd and tr.even Alternating even and odd rows
    +
    top
    @@ -922,17 +1029,17 @@ of the index listing of the file that will be appended to the end of the index listing. Filename is the name of the file to include, and is taken to be relative to the location being indexed. If - Filename begins with a slash, it will be taken to be + Filename begins with a slash, as in example 2, it will be taken to be relative to the DocumentRoot.

    -

    Example

    - ReadmeName FOOTER.html -

    +
    # Example 1
    +ReadmeName FOOTER.html
    + + +
    # Example 2
    +ReadmeName /include/FOOTER.html
    -

    Example 2

    - ReadmeName /include/FOOTER.html -

    See also HeaderName, where this behavior is described in greater detail.

    @@ -945,7 +1052,28 @@ of the index listing  ja  |  ko  |  tr 

    - +
    top

    Comments

    Notice:
    This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.
    +
    \ No newline at end of file