From: William A. Rowe Jr Note that unlike ForceType, this directive
+is only provides the default mime-type. All other mime-type definitions,
+including filename extensions, that might identify the media type will
+override this default.
+
+ When placed into an Note that unlike DefaultType, this directive
+overrides all mime-type associations, including filename extensions, that
+might identify the media type.
+
+ When placed into an Another example: if you wanted to have the server display a status
+report whenever a URL of Syntax: SetInputFilter filter
-[filter] ... The The The order of the arguments determines the order in which the
-filters will process the content. If more than one filter is specified, they must be seperated by
+semicolons in the order in which they should process the content. See also the Filters documentation.DefaultType
. For
example:
would be appropriate for a directory which contained many gif images
-with filenames missing the .gif extension.DefaultType image/gif
+with filenames missing the .gif extension.
+
+
<Directory> directive
@@ -852,6 +864,45 @@ different sections are combined when a request is received
+ForceType directive
+
+Syntax: ForceType mime-type
+Context: directory, .htaccess
+Status: Base
+Module: core
+Compatibility: ForceType was introduced in mod_mime
+with Apache 1.1, and moved to the core in Apache 2.0..htaccess
file or a
+<Directory>
, or <Location>
or
+or <Files>
section, this directive forces all matching
+files to be served with the content type identification given by
+mime-type. For example, if you had a directory full of GIF
+files, but did not want to label them all with ".gif", you might want to use:
+
+ ForceType image/gif
+
+
+
HostNameLookups directive
+SetHandler directive
+
+Syntax: SetHandler handler-name
+Context: directory, files, location, .htaccess
+Status: Base
+Module: core
+Compatibility: SetHandler was introduced in mod_mime
+with Apache 1.1, and moved into the core with Apache 2.0.htaccess
file or a
+<Directory>
or <Location>
section,
+this directive forces all matching files to be parsed through the
+handler
+given by handler-name. For example, if you had a
+directory you wanted to be parsed entirely as imagemap rule files,
+regardless of extension, you might put the following into an
+.htaccess
file in that directory:
+
+ SetHandler imap-file
+
+
+http://servername/status
was
+called, you might put the following into access.conf:
+
+ <Location /status>
+ SetHandler server-status
+ </Location>
+
+
+
+
SetInputFilter directive
+>Syntax: SetInputFilter filter[;filter...]
Context: directory
+>Context: directory, files, location, .htaccess
Status: coreSetInputFilter
directive sets the filters
-which will process client requests when they are received by the
-server.SetInputFilter
directive sets the filter or filters
+which will process client requests and POST input when they are received
+by the server. This is in addition to any filters defined elsewhere,
+including the AddInputFilter
+directive.
The SetOutputFilter
directive sets the filters which
will process responses from the server before they are sent to the
-client. For example, the following configuration will process
+client. This is in addition to any filters defined elsewhere,
+including the AddOutputFilter
+directive.
/www/data/
directory for
server-side includes.
@@ -2499,8 +2602,8 @@ server-side includes.
</Directory>
-The order of the arguments determines the order in which the -filters will process the content.
+If more than one filter is specified, they must be seperated by +semicolons in the order in which they should process the content.
See also the Filters documentation.
diff --git a/docs/manual/mod/mod_mime.html b/docs/manual/mod/mod_mime.html index 3736515256..89e6d3de4d 100644 --- a/docs/manual/mod/mod_mime.html +++ b/docs/manual/mod/mod_mime.html @@ -15,8 +15,9 @@This module provides for determining the types of files -from the filename and for association of handlers with files.
+This module associates the request filename's extensions (e.g. .html) with +the file's behavior (handlers and filters) and content (mime-type, language, +character set and encoding.)
Summary -This module is used to determine various bits of "meta information" -about documents. This information relates to the content of the -document and is returned to the browser or used in content-negotiation -within the server. In addition, a "handler" can be set for a document, -which determines how the document will be processed within the server. +This module is used to associate various bits of "meta information" with +files by their filename extensions. This information relates the filename +of the document to it's mime-type, language, character set and encoding. +This information is sent to the browser, and participates in content +negotiation, so the user's preferences are respected when choosing one of +several possible files to serve. See +mod_negotiation for more information about +content negotation. + +
+ +The directives AddHandler, +AddOutputFilter, and +AddInputFilter control the modules or +scripts that serve the document. + +
+ +In addition, mod_mime may define the "handler" for a document, which controls +which module or script will serve the document. With the introduction of +"filters" in Apache 2.0, mod_mime can also define the filters that the +the content should be processed through (e.g. the Includes output filter for +server side scripting) and what filters the client request and POST content +should be processed through (the input filters.)
The directives AddCharset, -AddEncoding, AddHandler, -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, handler, -content-language, and MIME-type (content-type) of documents. The -directive TypesConfig is used to specify a -file which also maps extensions onto MIME types. The directives ForceType and SetHandler are used to associated all the files -in a given location (e.g., a particular directory) onto a particular -MIME type or handler. +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 directive TypesConfig is used to specify a +file which also maps extensions onto MIME types. Most administrators use +the provided mime.types file which associates common filename extensions +with IANA registered content types. This simplifies the httpd.conf file +by providing the + +
+ +The core directives ForceType and +SetHandler are used to associate +all the files in a given container (e.g., <location>, +<directory>, or <Files>) with a particular MIME-type or +handler. These settings override any filename extension mappings +defined in mod_mime.
Note that changing the type or encoding of a file does not change the
value of the Last-Modified
header. Thus, previously cached
copies may still be used by a client or proxy, with the previous headers.
+If you change the meta-information (language, content type, character set
+or encoding) you may need to 'touch' affected files (updating their last
+modified date) to ensure that all visitors are receive the corrected
+content headers.
The language specification is the two-letter abbreviation for the language. The charset is the name of the particular -character set which should be used. +character set which should be used.
See also: Files with -multiple extensions +multiple extensions
+ +Syntax: AddInputFilter filter[;filter...] extension [extension ...]
+Default: none
+Context: directory, files, location, .htaccess
+Status: mod_mime
+Compatibility: AddInputFilter is only available in
+Apache 2.0.26 and later.
+ +
AddInputFilter maps the filename extensions extension to the +filter or filters which will process client requests and POST input +when they are received by the server. This is in addition to any +filters defined elsewhere, including the +SetInputFilter directive. +This mapping is merged over any already in force, overriding any +mappings that already exist for the same extension.
+ +If more than one filter is specified, they must be seperated by +semicolons in the order in which they should process the content. Both +the filter and extension arguments are case-insensitive, and +the extension may be specified with or without a leading dot.
+ +See also the Filters documentation.
See also: Files with
-multiple extensions
-
-See also: mod_negotiation
-
Syntax: AddOutputFilter filter[;filter...] extension [extension ...]
+Default: none
+Context: directory, files, location, .htaccess
+Status: mod_mime
+Compatibility: AddOutputFilter is only available in
+Apache 2.0.26 and later.
+ + +
The AddOutputFilter
directive maps the filename extensions
+extension to the filters which will process responses from the
+server before they are sent to the client. This is in addition to any
+filters defined elsewhere, including the
+SetOutputFilter directive.
+This mapping is merged over any already in force, overriding any
+mappings that already exist for the same extension.
+ AddOutputFilter INCLUDES shtml
+
+
+If more than one filter is specified, they must be seperated by +semicolons in the order in which they should process the content. Both +the filter and extension arguments are case-insensitive, and +the extension may be specified with or without a leading dot.
+ +See also the Filters documentation.
See also: Files with -multiple extensions +multiple extensions
-See also: mod_negotiation
-
See also: Files with
-multiple extensions
+multiple extensions, mod_negotiation
- -
When placed into an .htaccess
file or a
-<Directory>
or <Location>
section,
-this directive forces all matching files to be served
-as the content type given by media type. For example, if you
-had a directory full of GIF files, but did not want to label them all with
-".gif", you might want to use:
-
- ForceType image/gif --
Note that this will override any filename extensions that might determine -the media type.
+ +
+The RemoveInputFilter directive removes any input filter
+associations for files with the given extensions. This allows
+.htaccess
files in subdirectories to undo any associations
+inherited from parent directories or the server config files.
The extension argument is case-insensitive, and can +be specified with or without a leading dot.
+ ++ +
+The RemoveOutputFilter directive removes any output filter
+associations for files with the given extensions. This allows
+.htaccess
files in subdirectories to undo any associations
+inherited from parent directories or the server config files.
The extension argument is case-insensitive, and can +be specified with or without a leading dot.
+ +- -
When placed into an .htaccess
file or a
-<Directory>
or <Location>
section,
-this directive forces all matching files to be parsed through the
-handler
-given by handler-name. For example, if you had a
-directory you wanted to be parsed entirely as imagemap rule files,
-regardless of extension, you might put the following into an
-.htaccess
file in that directory:
-
- SetHandler imap-file -- -
Another example: if you wanted to have the server display a status
-report whenever a URL of http://servername/status
was
-called, you might put the following into access.conf:
-
- <Location /status> - SetHandler server-status - </Location> --