From: William A. Rowe Jr Date: Sat, 1 Sep 2001 02:25:22 +0000 (+0000) Subject: Move ForceType/SetHandler from mod_mime to core, copy the Set*Filter X-Git-Tag: 2.0.26~349 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa5e641aa7d943acd60ab60c9d48dc99b419c280;p=apache Move ForceType/SetHandler from mod_mime to core, copy the Set*Filter description for Add*Filter in mod_mime, and cross reference them. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90864 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/core.html b/docs/manual/mod/core.html index 82b55c0224..e0c240df39 100644 --- a/docs/manual/mod/core.html +++ b/docs/manual/mod/core.html @@ -38,6 +38,7 @@ always available.
  • ErrorLog
  • <Files>
  • <FilesMatch> +
  • ForceType
  • HostNameLookups
  • IdentityCheck
  • <IfDefine> @@ -72,6 +73,7 @@ always available.
  • ServerRoot
  • ServerSignature
  • ServerTokens +
  • SetHandler
  • SetInputFilter
  • SetOutputFilter
  • TimeOut @@ -223,12 +225,15 @@ Allow use of the authorization directives
    Allow use of the directives controlling document types -(AddEncoding, -AddLanguage, -AddType, -DefaultType, +(DefaultType, ErrorDocument, -LanguagePriority, etc.). +ForceType, +LanguagePriority, +SetHandler, +SetInputFilter, +SetOutputFilter, +and mod_mime Add* and Remove* directives, +etc.).
    Indexes
    @@ -425,7 +430,14 @@ the event of an unknown type it uses the DefaultType. For example:
    DefaultType image/gif
    would be appropriate for a directory which contained many gif images -with filenames missing the .gif extension.


    +with filenames missing the .gif extension. + +

    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.

    + +

    <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.

    + +

    When placed into an .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
    +
    +

    Note that unlike DefaultType, this directive +overrides all mime-type associations, including filename extensions, that +might identify the media type.

    + +
    +

    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

    + +

    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>
    +
    + +
    +

    SetInputFilter directive

    Syntax: SetInputFilter filter -[filter] ...
    +>Syntax: SetInputFilter filter[;filter...]
    Context: directory
    +>Context: directory, files, location, .htaccess
    Status: core

    -

    The SetInputFilter directive sets the filters -which will process client requests when they are received by the -server.

    +

    The 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 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.

    @@ -2481,7 +2580,7 @@ filters will process the content.

    Context: directory
    +>Context: directory, files, location, .htaccess

    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.

    + +For example, the following configuration will process all files in the /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 @@

    Module mod_mime

    -

    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.

    Directives

    @@ -188,7 +224,7 @@ Content-Type: text/plain; charset=ISO-8859-2

    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.


    @@ -362,7 +398,48 @@ be specified with or without a leading dot.

    See also: Files with -multiple extensions +multiple extensions

    + +
    + +

    AddInputFilter directive

    +

    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.


    @@ -433,11 +510,56 @@ be specified with or without a leading dot.

    See also: Files with -multiple extensions -
    -See also: mod_negotiation -

    +multiple extensions, mod_negotiation

    + +
    +

    AddOutputFilter directive

    +

    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.

    + +For example, the following configuration will process all .shtml files +for server-side includes.

    + +
    +  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.


    @@ -487,7 +609,7 @@ be specified with or without a leading dot.

    See also: Files with -multiple extensions +multiple extensions


    @@ -538,50 +660,12 @@ language attribute.

    -See also: mod_negotiation -
    See also: Files with -multiple extensions +multiple extensions, mod_negotiation


    -

    ForceType directive

    - -Syntax: ForceType media-type
    -Context: directory, .htaccess
    -Status: Base
    -Module: mod_mime
    -Compatibility: ForceType is only available in Apache -1.1 and later.

    - -

    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.


    -

    RemoveCharset directive


    +

    RemoveInputFilter directive

    + +Syntax: RemoveInputFilter extension + [extension] ...
    +Context: directory, .htaccess
    +Status: Base
    +Module: mod_mime
    +Compatibility: RemoveInputFilter is only available in +Apache 2.0.26 and later.

    + +

    +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.

    + +
    +

    RemoveLanguage directive


    +

    RemoveOutputFilter directive

    + +Syntax: RemoveOutputFilter extension + [extension] ...
    +Context: directory, .htaccess
    +Status: Base
    +Module: mod_mime
    +Compatibility: RemoveOutputFilter is only available in +Apache 2.0.26 and later.

    + +

    +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.

    + +
    +

    RemoveType directive


    -

    SetHandler directive

    - -Syntax: SetHandler handler-name
    -Context: directory, .htaccess
    -Status: Base
    -Module: mod_mime
    -Compatibility: SetHandler is only available in Apache -1.1 and later.

    - -

    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>
    -
    -
    -

    TypesConfig directive