Commit 101ce6be authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  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
parent 7117fe12
Loading
Loading
Loading
Loading
+121 −18
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ always available.
<LI><A HREF="#errorlog">ErrorLog</A>
<LI><A HREF="#files">&lt;Files&gt;</A>
<LI><A HREF="#filesmatch">&lt;FilesMatch&gt;</A>
<LI><a href="#forcetype">ForceType</a>
<LI><A HREF="#hostnamelookups">HostNameLookups</A>
<LI><A HREF="#identitycheck">IdentityCheck</A>
<LI><A HREF="#ifdefine">&lt;IfDefine&gt;</A>
@@ -72,6 +73,7 @@ always available.
<LI><A HREF="#serverroot">ServerRoot</A>
<LI><A HREF="#serversignature">ServerSignature</A>
<LI><A HREF="#servertokens">ServerTokens</A>
<LI><a href="#sethandler">SetHandler</a>
<LI><A HREF="#setinputfilter">SetInputFilter</A>
<LI><A HREF="#setoutputfilter">SetOutputFilter</A>
<LI><A HREF="#timeout">TimeOut</A>
@@ -223,12 +225,15 @@ Allow use of the authorization directives
<DD>
<!--%plaintext &lt;?INDEX {\tt FileInfo} override&gt; -->
Allow use of the directives controlling document types
(<A HREF="mod_mime.html#addencoding">AddEncoding</A>,
<A HREF="mod_mime.html#addlanguage">AddLanguage</A>,
<A HREF="mod_mime.html#addtype">AddType</A>,
<A HREF="#defaulttype">DefaultType</A>,
(<A HREF="#defaulttype">DefaultType</A>,
<A HREF="#errordocument">ErrorDocument</A>,
<A HREF="mod_negotiation.html#languagepriority">LanguagePriority</A>, <EM>etc.</EM>).
<A href="#forcetype">ForceType</A>,
<A HREF="mod_negotiation.html#languagepriority">LanguagePriority</A>,
<A href="#sethandler">SetHandler</A>,
<A HREF="#setinputfilter">SetInputFilter</A>,
<A HREF="#setoutputfilter">SetOutputFilter</A>,
and <A HREF="mod_mime.html">mod_mime Add* and Remove* directives</A>,
<EM>etc.</EM>).
<DT>Indexes
<DD>
<!--%plaintext &lt;?INDEX {\tt Indexes} override&gt; -->
@@ -425,7 +430,14 @@ the event of an unknown type it uses the <CODE>DefaultType</CODE>. For
example:
<BLOCKQUOTE><CODE>DefaultType image/gif</CODE></BLOCKQUOTE>
would be appropriate for a directory which contained many gif images
with filenames missing the .gif extension.<P><HR>
with filenames missing the .gif extension.

<P>Note that unlike <A HREF="#forcetype">ForceType</A>, 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.</P>

<HR>

<H2><A NAME="directory">&lt;Directory&gt; directive</A></H2>
<!--%plaintext &lt;?INDEX {\tt Directory} section directive&gt; -->
@@ -852,6 +864,45 @@ different sections are combined when a request is received

<HR>

<h2><a name="forcetype">ForceType</a> directive</h2>

<a
 href="directive-dict.html#Syntax"
 rel="Help"
><strong>Syntax:</strong></a> ForceType <em>mime-type</em><br>
<a
 href="directive-dict.html#Context"
 rel="Help"
><strong>Context:</strong></a> directory, .htaccess<br>
<a
 href="directive-dict.html#Status"
 rel="Help"
><strong>Status:</strong></a> Base<br>
<a
 href="directive-dict.html#Module"
 rel="Help"
><strong>Module:</strong></a> core<br>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> ForceType was introduced in mod_mime
with Apache 1.1, and moved to the core in Apache 2.0.<P>

<P>When placed into an <code>.htaccess</code> file or a
<code>&lt;Directory&gt;</code>, or <code>&lt;Location&gt;</code> or
or <code>&lt;Files&gt;</code> section, this directive forces all matching 
files to be served with the content type identification given by 
<em>mime-type</em>. 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:
<pre>
    ForceType image/gif
</pre>
<P>Note that unlike <A HREF="#defaulttype">DefaultType</A>, this directive 
overrides all mime-type associations, including filename extensions, that 
might identify the media type.</P>

<HR>

<H2><A NAME="hostnamelookups">HostNameLookups directive</A></H2>
<!--%plaintext &lt;?INDEX {\tt HostNameLookups} directive&gt; -->
<A
@@ -2438,12 +2489,58 @@ disabled on a virtualhost-by-virtualhost basis.

<HR>

<h2><a name="sethandler">SetHandler</a> directive</h2>

<a
 href="directive-dict.html#Syntax"
 rel="Help"
><strong>Syntax:</strong></a> SetHandler <em>handler-name</em><br>
<a
 href="directive-dict.html#Context"
 rel="Help"
><strong>Context:</strong></a> directory, files, location, .htaccess<br>
<a
 href="directive-dict.html#Status"
 rel="Help"
><strong>Status:</strong></a> Base<br>
<a
 href="directive-dict.html#Module"
 rel="Help"
><strong>Module:</strong></a> core<br>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> SetHandler was introduced in mod_mime 
with Apache 1.1, and moved into the core with Apache 2.0<P>

<P>When placed into an <code>.htaccess</code> file or a
<code>&lt;Directory&gt;</code> or <code>&lt;Location&gt;</code> section,
this directive forces all matching files to be parsed through the
<a href="../handler.html">handler</a>
given by <em>handler-name</em>. 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
<code>.htaccess</code> file in that directory:
<pre>
    SetHandler imap-file
</pre>

<P>Another example: if you wanted to have the server display a status
report whenever a URL of <code>http://servername/status</code> was
called, you might put the following into access.conf:
<pre>
    &lt;Location /status&gt;
    SetHandler server-status
    &lt;/Location&gt;
</pre>

<HR>

<H2><A NAME="setinputfilter">SetInputFilter directive</A></H2>
<P><A
 HREF="directive-dict.html#Syntax"
 REL="Help"
><STRONG>Syntax:</STRONG></A> SetInputFilter <EM>filter</EM> 
[<EM>filter</EM>] ...<BR>
><STRONG>Syntax:</STRONG></A> SetInputFilter <EM>filter</EM>[<EM>;filter</EM>...]<BR>
<A
 HREF="directive-dict.html#Default"
 REL="Help"
@@ -2451,18 +2548,20 @@ disabled on a virtualhost-by-virtualhost basis.
<A
 HREF="directive-dict.html#Context"
 REL="Help"
><STRONG>Context:</STRONG></A> directory<BR>
><STRONG>Context:</STRONG></A> directory, files, location, .htaccess<BR>
<A
 HREF="directive-dict.html#Status"
 REL="Help"
><STRONG>Status:</STRONG></A> core</P>

<p>The <code>SetInputFilter</code> directive sets the filters
which will process client requests when they are received by the
server.</p>
<p>The <code>SetInputFilter</code> 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 <a href="mod_mime.html#addinputfilter">AddInputFilter</a> 
directive.</p>

<p>The order of the arguments determines the order in which the
filters will process the content.</p>
<p>If more than one filter is specified, they must be seperated by
semicolons in the order in which they should process the content.</p>

<p>See also the <a href="../filter.html">Filters</a> documentation.</p>

@@ -2481,7 +2580,7 @@ filters will process the content.</p>
<A
 HREF="directive-dict.html#Context"
 REL="Help"
><STRONG>Context:</STRONG></A> directory<BR>
><STRONG>Context:</STRONG></A> directory, files, location, .htaccess<BR>
<A
 HREF="directive-dict.html#Status"
 REL="Help"
@@ -2489,7 +2588,11 @@ filters will process the content.</p>

<P>The <code>SetOutputFilter</code> 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 <a href="mod_mime.html#addoutputfilter">AddOutputFilter</a> 
directive.</p>

For example, the following configuration will process
all files in the <code>/www/data/</code> directory for 
server-side includes.</P>

@@ -2499,8 +2602,8 @@ server-side includes.</P>
&lt;/Directory&gt;
</CODE></BLOCKQUOTE>

<p>The order of the arguments determines the order in which the
filters will process the content.</p>
<p>If more than one filter is specified, they must be seperated by
semicolons in the order in which they should process the content.</p>

<p>See also the <a href="../filter.html">Filters</a> documentation.</p>

+224 −114
Original line number Diff line number Diff line
@@ -15,8 +15,9 @@
<!--#include virtual="header.html" -->
<h1 align="center">Module mod_mime</h1>

<p>This module provides for determining the types of files
from the filename and for association of handlers with files.</p>
<p>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.)</p>

<p><a
href="module-dict.html#Status"
@@ -36,48 +37,83 @@ rel="Help"

<h2>Summary</h2>

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 
<a href="mod_negotiation">mod_negotiation</a> for more information about
content negotation.

<P>

The directives <a href="#addhandler">AddHandler</a>, 
<a href="#addoutputfilter">AddOutputFilter</a>, and
<a href="#addinputfilter">AddInputFilter</a> control the modules or
scripts that serve the document.

<P>

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

<P>

The directives <a href="#addcharset">AddCharset</a>,
<a href="#addencoding">AddEncoding</a>, <a href="#addhandler">AddHandler</a>,
<a href="#addlanguage">AddLanguage</a> and <a href="#addtype">AddType</a>
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 <a href="#typesconfig">TypesConfig</a> is used to specify a
file which also maps extensions onto MIME types. The directives <a
href="#forcetype">ForceType</a> and <a
href="#sethandler">SetHandler</a> are used to associated all the files
in a given location (<em>e.g.</em>, a particular directory) onto a particular
MIME type or handler.
<a href="#addencoding">AddEncoding</a>, <a href="#addlanguage">AddLanguage</a> 
and <a href="#addtype">AddType</a> 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.

<P>

The directive <a href="#typesconfig">TypesConfig</a> 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 

<P>

The core directives <a href="core.html#forcetype">ForceType</a> and 
<a href="core.html#sethandler">SetHandler</a> are used to associate
all the files in a given container (<em>e.g.</em>, &lt;location&gt;, 
&lt;directory&gt;, or &lt;Files&gt;) with a particular MIME-type or 
handler.  These settings override any filename extension mappings 
defined in mod_mime.

<P>

Note that changing the type or encoding of a file does not change the
value of the <CODE>Last-Modified</code> 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.

<h2>Directives</h2>
<ul>
<li><a href="#addcharset">AddCharset</a></li>
<li><a href="#addencoding">AddEncoding</a>
<li><a href="#addhandler">AddHandler</a>
<li><a href="#addinputfilter">AddInputFilter</a>
<li><a href="#addlanguage">AddLanguage</a>
<li><a href="#addoutputfilter">AddOutputFilter</a>
<li><a href="#addtype">AddType</a>
<li><a href="#defaultlanguage">DefaultLanguage</a>
<li><a href="#forcetype">ForceType</a>
<li><a href="#removecharset">RemoveCharset</a>
<li><a href="#removeencoding">RemoveEncoding</a>
<li><a href="#removehandler">RemoveHandler</a>
<li><a href="#removeinputfilter">RemoveInputFilter</a>
<li><a href="#removelanguage">RemoveLanguage</a>
<li><a href="#removeoutputfilter">RemoveOutputFilter</a>
<li><a href="#removetype">RemoveType</a>
<li><a href="#sethandler">SetHandler</a>
<li><a href="#typesconfig">TypesConfig</a>
</ul>

@@ -188,7 +224,7 @@ Content-Type: text/plain; charset=ISO-8859-2
<p>
The language specification is the two-letter abbreviation for the
language. The <samp>charset</samp> is the name of the particular
character set which should be used.
character set which should be used.</p>

<hr>

@@ -362,7 +398,48 @@ be specified with or without a leading dot.</p>
<P>

<strong>See also</strong>: <a href="#multipleext">Files with
multiple extensions</a>
multiple extensions</a></p>

<HR>

<H2><A NAME="addinputfilter">AddInputFilter directive</A></H2>
<P><A
 HREF="directive-dict.html#Syntax"
 REL="Help"
><STRONG>Syntax:</STRONG></A> AddInputFilter <EM>filter</EM>[<EM
>;filter</EM>...] extension</em> [<em>extension</em> ...]<BR>
<A
 HREF="directive-dict.html#Default"
 REL="Help"
><STRONG>Default:</STRONG></A> none<BR>
<A
 HREF="directive-dict.html#Context"
 REL="Help"
><STRONG>Context:</STRONG></A> directory, files, location, .htaccess<BR>
<A
 HREF="directive-dict.html#Status"
 REL="Help"
><STRONG>Status:</STRONG></A> mod_mime<BR>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> AddInputFilter is only available in 
Apache 2.0.26 and later.<P>

<P>AddInputFilter maps the filename extensions <em>extension</em> 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 
<a href="core.html#setinputfilter">SetInputFilter</a> directive.
This mapping is merged over any already in force, overriding any 
mappings that already exist for the same <em>extension</em>.</p>

<p>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 <em>extension</em> arguments are case-insensitive, and 
the extension may be specified with or without a leading dot.</p>

<p>See also the <a href="../filter.html">Filters</a> documentation.</p>

<hr>

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

<P>
<strong>See also</strong>: <a href="#multipleext">Files with
multiple extensions</a>
<br>
<strong>See also</strong>: <a
href="./mod_negotiation.html">mod_negotiation</a>
</P>
multiple extensions</a>, <a href="./mod_negotiation.html"
>mod_negotiation</a></P>

<HR>
<H2><A NAME="addoutputfilter">AddOutputFilter directive</A></H2>
<P><A
 HREF="directive-dict.html#Syntax"
 REL="Help"
><STRONG>Syntax:</STRONG></A> AddOutputFilter <EM>filter</EM>[<EM
>;filter</EM>...] extension</em> [<em>extension</em> ...]<BR>
<A
 HREF="directive-dict.html#Default"
 REL="Help"
><STRONG>Default:</STRONG></A> none<BR>
<A
 HREF="directive-dict.html#Context"
 REL="Help"
><STRONG>Context:</STRONG></A> directory, files, location, .htaccess<BR>
<A
 HREF="directive-dict.html#Status"
 REL="Help"
><STRONG>Status:</STRONG></A> mod_mime<BR>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> AddOutputFilter is only available in 
Apache 2.0.26 and later.<P>


<P>The <code>AddOutputFilter</code> directive maps the filename extensions 
<em>extension</em> 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 
<a href="core.html#setoutputfilter">SetOutputFilter</a> directive.
This mapping is merged over any already in force, overriding any 
mappings that already exist for the same <em>extension</em>.</p>

For example, the following configuration will process all .shtml files 
for server-side includes.</P>

<BLOCKQUOTE><CODE>
&nbsp;&nbsp;AddOutputFilter INCLUDES shtml<BR>
</CODE></BLOCKQUOTE>

<p>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 <em>extension</em> arguments are case-insensitive, and 
the extension may be specified with or without a leading dot.</p>

<p>See also the <a href="../filter.html">Filters</a> documentation.</p>

<hr>

@@ -487,7 +609,7 @@ be specified with or without a leading dot.</p>
<P>

<strong>See also</strong>: <a href="#multipleext">Files with
multiple extensions</a>
multiple extensions</a></p>

<hr>

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

<P>

<strong>See also</strong>: <a
href="./mod_negotiation.html">mod_negotiation</a>
<br>
<strong>See also</strong>: <a href="#multipleext">Files with
multiple extensions</a>
multiple extensions</a>, <a href="./mod_negotiation.html"
>mod_negotiation</a></P>

<hr>

<h2><a name="forcetype">ForceType</a> directive</h2>

<a
 href="directive-dict.html#Syntax"
 rel="Help"
><strong>Syntax:</strong></a> ForceType <em>media-type</em><br>
<a
 href="directive-dict.html#Context"
 rel="Help"
><strong>Context:</strong></a> directory, .htaccess<br>
<a
 href="directive-dict.html#Status"
 rel="Help"
><strong>Status:</strong></a> Base<br>
<a
 href="directive-dict.html#Module"
 rel="Help"
><strong>Module:</strong></a> mod_mime<br>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> ForceType is only available in Apache
1.1 and later.<P>

<P>When placed into an <code>.htaccess</code> file or a
<code>&lt;Directory&gt;</code> or <code>&lt;Location&gt;</code> section,
this directive forces all matching files to be served
as the content type given by <em>media type</em>. 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:
<pre>
    ForceType image/gif
</pre>
<P>Note that this will override any filename extensions that might determine
the media type.</P><hr>

<h2><a name="removecharset">RemoveCharset</a> directive</h2>

<a
@@ -727,6 +811,42 @@ be specified with or without a leading dot.</p>

<hr>

<h2><a name="removeinputfilter">RemoveInputFilter</a> directive</h2>

<a
 href="directive-dict.html#Syntax"
 rel="Help"
><strong>Syntax:</strong></a> RemoveInputFilter <em>extension</em>
     [<em>extension</em>] ...<br>
<a
 href="directive-dict.html#Context"
 rel="Help"
><strong>Context:</strong></a> directory, .htaccess<br>
<a
 href="directive-dict.html#Status"
 rel="Help"
><strong>Status:</strong></a> Base<br>
<a
 href="directive-dict.html#Module"
 rel="Help"
><strong>Module:</strong></a> mod_mime<br>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> RemoveInputFilter is only available in 
Apache 2.0.26 and later.<P>

<P>
The <samp>RemoveInputFilter</samp> directive removes any input filter
associations for files with the given extensions.  This allows 
<code>.htaccess</code> files in subdirectories to undo any associations 
inherited from parent directories or the server config files.</P>

<p>The <em>extension</em> argument is case-insensitive, and can
be specified with or without a leading dot.</p>

<hr>

<h2><a name="removelanguage">RemoveLanguage</a> directive</h2>

<a
@@ -764,6 +884,42 @@ be specified with or without a leading dot.</p>

<hr>

<h2><a name="removeoutputfilter">RemoveOutputFilter</a> directive</h2>

<a
 href="directive-dict.html#Syntax"
 rel="Help"
><strong>Syntax:</strong></a> RemoveOutputFilter <em>extension</em>
     [<em>extension</em>] ...<br>
<a
 href="directive-dict.html#Context"
 rel="Help"
><strong>Context:</strong></a> directory, .htaccess<br>
<a
 href="directive-dict.html#Status"
 rel="Help"
><strong>Status:</strong></a> Base<br>
<a
 href="directive-dict.html#Module"
 rel="Help"
><strong>Module:</strong></a> mod_mime<br>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> RemoveOutputFilter is only available in 
Apache 2.0.26 and later.<P>

<P>
The <samp>RemoveOutputFilter</samp> directive removes any output filter
associations for files with the given extensions.  This allows 
<code>.htaccess</code> files in subdirectories to undo any associations 
inherited from parent directories or the server config files.</P>

<p>The <em>extension</em> argument is case-insensitive, and can
be specified with or without a leading dot.</p>

<hr>

<h2><a name="removetype">RemoveType</a> directive</h2>

<a
@@ -815,52 +971,6 @@ be specified with or without a leading dot.</p>

<hr>

<h2><a name="sethandler">SetHandler</a> directive</h2>

<a
 href="directive-dict.html#Syntax"
 rel="Help"
><strong>Syntax:</strong></a> SetHandler <em>handler-name</em><br>
<a
 href="directive-dict.html#Context"
 rel="Help"
><strong>Context:</strong></a> directory, .htaccess<br>
<a
 href="directive-dict.html#Status"
 rel="Help"
><strong>Status:</strong></a> Base<br>
<a
 href="directive-dict.html#Module"
 rel="Help"
><strong>Module:</strong></a> mod_mime<br>
<a
 href="directive-dict.html#Compatibility"
 rel="Help"
><strong>Compatibility:</strong></a> SetHandler is only available in Apache
1.1 and later.<P>

<P>When placed into an <code>.htaccess</code> file or a
<code>&lt;Directory&gt;</code> or <code>&lt;Location&gt;</code> section,
this directive forces all matching files to be parsed through the
<a href="../handler.html">handler</a>
given by <em>handler-name</em>. 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
<code>.htaccess</code> file in that directory:
<pre>
    SetHandler imap-file
</pre>

<P>Another example: if you wanted to have the server display a status
report whenever a URL of <code>http://servername/status</code> was
called, you might put the following into access.conf:
<pre>
    &lt;Location /status&gt;
    SetHandler server-status
    &lt;/Location&gt;
</pre>
<hr>

<h2><a name="typesconfig">TypesConfig</a> directive</h2>
<a
 href="directive-dict.html#Syntax"