From 8b134164430caa6e2c7ac5b57db077245e120eb1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Oct 2001 02:19:00 +0000 Subject: [PATCH] Clarify the new MultiviewsMatch directive. I wanted this down on 'paper', even if it isn't proofread - please feel free to touch up. BTW - the new 'cleaned' formatting really stinks for hand-editing, the indentation really needs works. Our per-directive meta-info is the ugliest aspect. Would be good if the cleanup code could be customized to make the html not only clean, but legible ;) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91464 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_mime.html | 126 ++++++++++++++++++++++++---------- 1 file changed, 88 insertions(+), 38 deletions(-) diff --git a/docs/manual/mod/mod_mime.html b/docs/manual/mod/mod_mime.html index b004fac1ae..9a50b1723c 100644 --- a/docs/manual/mod/mod_mime.html +++ b/docs/manual/mod/mod_mime.html @@ -39,10 +39,13 @@ href="mod_negotiation">mod_negotiation for more information about content negotiation. -

The directives AddHandler, AddOutputFilter, and AddInputFilter control the modules - or scripts that serve the document.

+

The directives AddCharset, AddEncoding, AddLanguage and AddType are all used to map file extensions + onto the meta-information for that file. Respectively they set + the character set, content-encoding, content-language, and + MIME-type (content-type) of documents.

In addition, mod_mime may define the "handler" for a document, which controls which module or script will serve the @@ -53,13 +56,13 @@ and POST content should be processed through (the input filters.)

-

The directives AddCharset, AddEncoding, AddLanguage and AddType are all used to map file extensions - onto the meta-information for that file. Respectively they set - the character set, content-encoding, content-language, and - MIME-type (content-type) of documents.

+

The directives AddHandler, AddOutputFilter, and AddInputFilter control the modules + or scripts that serve the document. The + MultiviewsMatch directive allows + mod_negotiation to consider these + file extensions to included when testing Multiviews matches.

The directive TypesConfig is used to specify a file which also maps extensions onto MIME types. @@ -117,6 +120,8 @@

  • DefaultLanguage
  • +
  • MultiviewsMatch
  • +
  • RemoveCharset
  • RemoveEncoding
  • @@ -137,23 +142,15 @@

    See also: MimeMagicFile.

    -

    Files with Multiple +

    Files with Multiple Extensions

    - Files can have more than one extension, and the order of the + +

    Files can have more than one extension, and the order of the extensions is normally irrelevant. For example, if the file welcome.html.fr maps onto content type - text/html and language French then the file - welcome.fr.html will map onto exactly the same - information. The only exception to this is if an extension is - given which Apache does not know how to handle. In this case it - will "forget" about any information it obtained from extensions - to the left of the unknown extension. So, for example, if the - extensions fr and html are mapped to the appropriate language - and type but extension xxx is not assigned to anything, then - the file welcome.fr.xxx.html will be associated - with content-type text/html but no language. - -

    If more than one extension is given which maps onto the same + text/html and language French then the file welcome.fr.html + will map onto exactly the same information. If more than one + extension is given which maps onto the same type of meta-information, then the one to the right will be used. For example, if ".gif" maps to the MIME-type image/gif and ".html" maps to the MIME-type text/html, then the file @@ -172,15 +169,15 @@ be used, and so it will be treated as a mod_imap imagemap file.

    -

    Content - encoding

    - A file of a particular MIME type can additionally be encoded a +

    Content encoding

    + +

    A file of a particular MIME type can additionally be encoded a particular way to simplify transmission over the Internet. While this usually will refer to compression, such as gzip, it can also refer to encryption, such a pgp or to an encoding such as UUencoding, which is designed for transmitting a binary file in an ASCII (text) - format. + format.

    The MIME RFC puts it this way:

    @@ -214,23 +211,32 @@

    Content-encoding: pkzip

    -

    Character sets and languages

    - Finally, in addition to file type, and the file encoding, +

    Character sets and languages

    + +

    In addition to file type and the file encoding, another important piece of information is what language a particular document is in, and in what character set the file should be displayed. For example, the document might be written in the Vietnamese alphabet, or in Cyrillic, and should be displayed as such. This information, also, is transmitted in - HTTP headers. + HTTP headers.

    -

    While the character set is useful for the browser, in order - to determine how to display the document, the language and the - character set are also used in the process of content - negotiation (See The character set, language encoding and mime type are all + used in the process of content negotiation (See mod_negotiation) to determine which document to give to the client, when there are - alternative documents in more than one language, or more than - one character set.

    + alternative documents in more than one character set, language, + encoding or mime type. All filename extensions associations + created with AddCharset, AddEncoding, + AddLanguage and AddType directives + (and extensions listed in the MimeMagicFile) + participate in this select process. Filename extensions that + are only associated using the AddHandler, + AddInputFilter or AddOutputFilter + directives may be included or excluded from matching by using + the MultiviewsMatch directive.

    + +Charset

    To convey this further information, Apache optionally sends a Content-Language header, to specify the language @@ -574,6 +580,50 @@ Content-Type: text/plain; charset=ISO-8859-2 multiple extensions


    +

    multiviewsmatch directive

    + Syntax: MultiviewsMatch + [NegotiatedOnly] [Handlers] [Filters] [All]
    + Context: server config, virtual + host, directory, .htaccess
    + Override: FileInfo
    + Status: Base
    + Module: mod_mime
    + Compatibility: only available + in Apache 2.0.26 and later. + +

    MultiviewsMatch permits three different behaviors for + mod_negotiation's Multiviews + feature. Multiviews allows a request for a file, e.g. index.html, + to match any negotiated extensions following the base request, + e.g. index.html.en, index.html,fr, or index.html.gz.

    + +

    The NegotiatedOnly option provides that every extension following + the base name must correlate to a recognized mod_mime extension for + content negotation, e.g. Charset, Content-Type, Language, or + Encoding. This is the strictest implementation with the fewest + unexpected side effects, and is the default behavior.

    + +

    To include extensions associated with Handlers and/or Filters, + set the MultiviewsMatch directive to either Handlers, Filters, or + both option keywords. If all other factors are equal, the smallest + file will be served, e.g. in deciding between index.html.cgi of 500 + characters and index.html.pl of 1000 bytes, the .cgi file would win + in this example. Users of .asis files might prefer to use the + Handler option, if .asis files are associated with the asis-handler.

    + +

    You may finally allow All extensions to match, even if mod_mime + doesn't recognize the extension. This was the behavior in Apache 1.3, + and can cause unpredicatable results, such as serving .old or .bak + files the webmaster never expected to be served.

    +
    +

    DefaultLanguage directive