From 8b134164430caa6e2c7ac5b57db077245e120eb1 Mon Sep 17 00:00:00 2001
From: "William A. Rowe Jr" 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 @@
See also: MimeMagicFile. Files can have more than one extension, and the order of the
extensions is normally irrelevant. For example, if the
file If more than one extension is given which maps onto the same
+ text/html and language French then the file 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: Content-encoding: pkzip 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.Files with Multiple
+
Files with Multiple
Extensions
- Files can have more than one extension, and the order of the
+
+ 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.
-
- 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
+
+ Character sets and languages
- Finally, in addition to file type, and the file encoding,
+Character sets and languages
+
+ 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.
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 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.
+