mirror of
https://github.com/apache/httpd.git
synced 2025-06-10 18:21:43 +03:00
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97140 13f79535-47bb-0310-9956-ffa450edef68
778 lines
54 KiB
XML
778 lines
54 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
|
||
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||
This file is generated from xml source: DO NOT EDIT
|
||
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||
--><title>mod_mime - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body><div id="page-header"><p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p><p class="apache">Apache HTTP Server Version 2.0</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">Modules</a></div><div id="page-content"><div id="preamble"><h1>Apache Module mod_mime</h1><table class="module"><tr><th><a href="module-dict.html#Description">Description:
|
||
</a></th><td>Associates the requested filename's extensions
|
||
with the file's behavior (handlers and filters)
|
||
and content (mime-type, language, character set and
|
||
encoding)</td></tr><tr><th><a href="module-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="module-dict.html#ModuleIdentifier">Module<EFBFBD>Identifier:
|
||
</a></th><td>mime_module</td></tr><tr><th><a href="module-dict.html#SourceFile">Source<EFBFBD>File:
|
||
</a></th><td>mod_mime.c</td></tr></table><h3>Summary</h3>
|
||
<p>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
|
||
<code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code> for more information
|
||
about content negotiation. </p>
|
||
|
||
<p>The directives <code class="directive"><a href="#addcharset">AddCharset</a></code>, <code class="directive"><a href="#addencoding">AddEncoding</a></code>, <code class="directive"><a href="#addlanguage">AddLanguage</a></code> and <code class="directive"><a href="#addtype">AddType</a></code> 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 <code class="directive"><a href="#typesconfig">TypesConfig</a></code> is used to specify a
|
||
file which also maps extensions onto MIME types. </p>
|
||
|
||
<p>In addition, <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> may define the <a href="../handler.html">handler</a> and <a href="../filter.html">filters</a> that originate and process
|
||
content. The directives <code class="directive"><a href="#addhandler">AddHandler</a></code>, <code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code>, and <code class="directive"><a href="#addinputfilter">AddInputFilter</a></code> control the modules
|
||
or scripts that serve the document. The <code class="directive"><a href="#multiviewsmatch">MultiviewsMatch</a></code> directive allows
|
||
<code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code> to consider these file extensions
|
||
to be included when testing Multiviews matches.</p>
|
||
|
||
<p>While <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> associates meta-information
|
||
with filename extensions, the <code class="module"><a href="../mod/core.html">core</a></code> server
|
||
provides directives that are used to associate all the files in a
|
||
given container (<em>e.g.</em>, <code class="directive"><a href="../mod/core.html#location"><location></a></code>, <code class="directive"><a href="../mod/core.html#directory"><directory></a></code>, or <code class="directive"><a href="../mod/core.html#files"><Files></a></code>) with particular
|
||
meta-information. These directives include <code class="directive"><a href="../mod/core.html#forcetype">ForceType</a></code>, <code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code>, <code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code>, and <code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code>. The core directives
|
||
override any filename extension mappings defined in
|
||
<code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code>.</p>
|
||
|
||
<p>Note that changing the meta-information for 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.</p>
|
||
</div><div id="quickview"><h3 class="directives">Directives</h3><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#addcharset">AddCharset</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#addencoding">AddEncoding</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#addhandler">AddHandler</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#addinputfilter">AddInputFilter</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#addlanguage">AddLanguage</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#addoutputfilter">AddOutputFilter</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#addtype">AddType</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#defaultlanguage">DefaultLanguage</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#modmimeusepathinfo">ModMimeUsePathInfo</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#multiviewsmatch">MultiviewsMatch</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#removecharset">RemoveCharset</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#removeencoding">RemoveEncoding</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#removehandler">RemoveHandler</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#removeinputfilter">RemoveInputFilter</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#removelanguage">RemoveLanguage</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#removeoutputfilter">RemoveOutputFilter</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#removetype">RemoveType</a></li>
|
||
<li><img alt="" src="../images/down.gif" /> <a href="#typesconfig">TypesConfig</a></li>
|
||
</ul><h3>Topics</h3><ul id="topics"><li><img alt="" src="../images/down.gif" /> <a href="#multipleext">Files with Multiple Extensions</a></li><li><img alt="" src="../images/down.gif" /> <a href="#contentencoding">Content encoding</a></li><li><img alt="" src="../images/down.gif" /> Character sets and languages</li></ul><h3>See also</h3><ul class="seealso"><li><code class="directive"><a href="../mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code></li><li><code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code></li><li><code class="directive"><a href="../mod/core.html#forcetype">ForceType</a></code></li><li><code class="directive"><a href="../mod/core.html#defaulttype">DefaultType</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code></li><li><code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="multipleext" id="multipleext">Files with Multiple Extensions</a></h2>
|
||
|
||
|
||
<p>Files can have more than one extension, and the order of the
|
||
extensions is <em>normally</em> irrelevant. For example, if the
|
||
file <code>welcome.html.fr</code> maps onto content type
|
||
text/html and language French then the file <code>welcome.fr.html</code>
|
||
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
|
||
<code>welcome.gif.html</code> will be associated with the
|
||
MIME-type "text/html".</p>
|
||
|
||
<p>Care should be taken when a file with multiple extensions
|
||
gets associated with both a MIME-type and a handler. This will
|
||
usually result in the request being by the module associated
|
||
with the handler. For example, if the <code>.imap</code>
|
||
extension is mapped to the handler "imap-file" (from mod_imap)
|
||
and the <code>.html</code> extension is mapped to the MIME-type
|
||
"text/html", then the file <code>world.imap.html</code> will be
|
||
associated with both the "imap-file" handler and "text/html"
|
||
MIME-type. When it is processed, the "imap-file" handler will
|
||
be used, and so it will be treated as a mod_imap imagemap
|
||
file.</p>
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="contentencoding" id="contentencoding">Content encoding</a></h2>
|
||
|
||
<p>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
|
||
<code>gzip</code>, it can also refer to encryption, such a
|
||
<code>pgp</code> or to an encoding such as UUencoding, which is
|
||
designed for transmitting a binary file in an ASCII (text)
|
||
format.</p>
|
||
|
||
<p>The MIME RFC puts it this way:</p>
|
||
|
||
<div class="note">
|
||
The Content-Encoding entity-header field is used as a
|
||
modifier to the media-type. When present, its value indicates
|
||
what additional content coding has been applied to the
|
||
resource, and thus what decoding mechanism must be applied in
|
||
order to obtain the media-type referenced by the Content-Type
|
||
header field. The Content-Encoding is primarily used to allow
|
||
a document to be compressed without losing the identity of
|
||
its underlying media type.
|
||
</div>
|
||
|
||
<p>By using more than one file extension (see <a href="#multipleext">section above about multiple file
|
||
extensions</a>), you can indicate that a file is of a
|
||
particular <em>type</em>, and also has a particular
|
||
<em>encoding</em>. </p>
|
||
|
||
<p>For example, you may have a file which is a Microsoft Word
|
||
document, which is pkzipped to reduce its size. If the
|
||
<code>.doc</code> extension is associated with the Microsoft
|
||
Word file type, and the <code>.zip</code> extension is
|
||
associated with the pkzip file encoding, then the file
|
||
<code>Resume.doc.zip</code>would be known to be a pkzip'ed Word
|
||
document.</p>
|
||
|
||
<p>Apache send a <code>Content-encoding</code> header with the
|
||
resource, in order to tell the client browser about the
|
||
encoding method.</p>
|
||
|
||
<div class="example"><p><code>Content-encoding: pkzip</code></p></div>
|
||
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2>Character sets and languages</h2>
|
||
|
||
|
||
|
||
<p>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.</p>
|
||
|
||
<p>The character set, language, encoding and mime type are all
|
||
used in the process of content negotiation (See
|
||
<code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>) to determine
|
||
which document to give to the client, when there are
|
||
alternative documents in more than one character set, language,
|
||
encoding or mime type. All filename extensions associations
|
||
created with <code class="module"><a href="../mod/AddCharset.html">AddCharset</a></code>, <code class="module"><a href="../mod/AddEncoding.html">AddEncoding</a></code>,
|
||
<code class="module"><a href="../mod/AddLanguage.html">AddLanguage</a></code> and <code class="module"><a href="../mod/AddType.html">AddType</a></code> directives
|
||
(and extensions listed in the <code class="module"><a href="../mod/MimeMagicFile.html">MimeMagicFile</a></code>)
|
||
participate in this select process. Filename extensions that
|
||
are only associated using the <code class="module"><a href="../mod/AddHandler.html">AddHandler</a></code>,
|
||
<code class="module"><a href="../mod/AddInputFilter.html">AddInputFilter</a></code> or <code class="module"><a href="../mod/AddOutputFilter.html">AddOutputFilter</a></code>
|
||
directives may be included or excluded from matching by using
|
||
the <code class="directive">MultiviewsMatch</code> directive.</p>
|
||
|
||
<h3>Charset</h3>
|
||
|
||
|
||
<p>To convey this further information, Apache optionally sends
|
||
a <code>Content-Language</code> header, to specify the language
|
||
that the document is in, and can append additional information
|
||
onto the <code>Content-Type</code> header to indicate the
|
||
particular character set that should be used to correctly
|
||
render the information.</p>
|
||
|
||
<div class="example"><p><code>
|
||
Content-Language: en, fr<br />
|
||
Content-Type: text/plain; charset=ISO-8859-2
|
||
</code></p></div>
|
||
|
||
<p>The language specification is the two-letter abbreviation
|
||
for the language. The <code>charset</code> is the name of the
|
||
particular character set which should be used.</p>
|
||
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddCharset" id="AddCharset">AddCharset</a> <a name="addcharset" id="addcharset">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Maps the given filename extensions
|
||
to the specified content charset</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>AddCharset <em>charset extension</em>
|
||
[<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>AddCharset is only available in Apache
|
||
1.3.10 and later</td></tr></table>
|
||
|
||
<p>The AddCharset directive maps the given filename extensions
|
||
to the specified content charset. <em>charset</em> is the MIME
|
||
charset parameter of filenames containing <em>extension</em>.
|
||
This mapping is added to any already in force, overriding any
|
||
mappings that already exist for the same <em>extension</em>.</p>
|
||
|
||
<p>Example:</p>
|
||
<div class="example"><p><code>
|
||
AddLanguage ja .ja<br />
|
||
AddCharset EUC-JP .euc<br />
|
||
AddCharset ISO-2022-JP .jis<br />
|
||
AddCharset SHIFT_JIS .sjis
|
||
</code></p></div>
|
||
|
||
<p>Then the document <code>xxxx.ja.jis</code> will be treated
|
||
as being a Japanese document whose charset is ISO-2022-JP (as
|
||
will the document <code>xxxx.jis.ja</code>). The AddCharset
|
||
directive is useful for both to inform the client about the
|
||
character encoding of the document so that the document can be
|
||
interpreted and displayed appropriately, and for <a href="../content-negotiation.html">content negotiation</a>,
|
||
where the server returns one from several documents based on
|
||
the client's charset preference.</p>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
|
||
<h3>See also</h3><ul><li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li><li><code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddEncoding" id="AddEncoding">AddEncoding</a> <a name="addencoding" id="addencoding">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Maps the given filename extensions
|
||
to the specified encoding type</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>AddEncoding
|
||
<em>MIME-enc extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr></table>
|
||
|
||
<p>The AddEncoding directive maps the given filename extensions
|
||
to the specified encoding type. <em>MIME-enc</em> is the MIME
|
||
encoding to use for documents containing the
|
||
<em>extension</em>. This mapping is added to any already in
|
||
force, overriding any mappings that already exist for the same
|
||
<em>extension</em>. Example:</p>
|
||
|
||
<div class="example"><p><code>
|
||
AddEncoding x-gzip .gz<br />
|
||
AddEncoding x-compress .Z
|
||
</code></p></div>
|
||
|
||
<p>This will cause filenames containing the .gz extension to be
|
||
marked as encoded using the x-gzip encoding, and filenames
|
||
containing the .Z extension to be marked as encoded with
|
||
x-compress. </p>
|
||
|
||
<p>Old clients expect <code>x-gzip</code> and
|
||
<code>x-compress</code>, however the standard dictates that
|
||
they're equivalent to <code>gzip</code> and
|
||
<code>compress</code> respectively. Apache does content
|
||
encoding comparisons by ignoring any leading <code>x-</code>.
|
||
When responding with an encoding Apache will use whatever form
|
||
(<em>i.e.</em>, <code>x-foo</code> or <code>foo</code>) the
|
||
client requested. If the client didn't specifically request a
|
||
particular form Apache will use the form given by the
|
||
<code>AddEncoding</code> directive. To make this long story
|
||
short, you should always use <code>x-gzip</code> and
|
||
<code>x-compress</code> for these two specific encodings. More
|
||
recent encodings, such as <code>deflate</code> should be
|
||
specified without the <code>x-</code>.</p>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddHandler" id="AddHandler">AddHandler</a> <a name="addhandler" id="addhandler">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Maps the filename extensions
|
||
to the specified handler</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>AddHandler
|
||
<em>handler-name extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr></table>
|
||
<p>Files having the name <em>extension</em> will be served by the
|
||
specified <a href="../handler.html">handler-name</a>. This mapping is
|
||
added to any already in force, overriding any mappings that already
|
||
exist for the same <em>extension</em>. For example, to activate CGI
|
||
scripts with the file extension "<code>.cgi</code>", you might
|
||
use:</p>
|
||
|
||
<div class="example"><p><code>
|
||
AddHandler cgi-script .cgi
|
||
</code></p></div>
|
||
|
||
<p>Once that has been put into your srm.conf or httpd.conf
|
||
file, any file containing the "<code>.cgi</code>" extension
|
||
will be treated as a CGI program.</p>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
|
||
<h3>See also</h3><ul><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddInputFilter" id="AddInputFilter">AddInputFilter</a> <a name="addinputfilter" id="addinputfilter">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Maps filename extensions
|
||
to the filters that will process
|
||
client requests</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>AddInputFilter
|
||
<em>filter</em>[<em>;filter</em>...] extension
|
||
[<em>extension</em> ...]</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>AddInputFilter
|
||
is only available in Apache 2.0.26 and later.</td></tr></table>
|
||
|
||
<p>AddInputFilter maps the filename extensions <em>extension</em>
|
||
to the <a href="../filter.html">filters</a> 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 separated
|
||
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>
|
||
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddLanguage" id="AddLanguage">AddLanguage</a> <a name="addlanguage" id="addlanguage">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Maps the given filename extension
|
||
to the specified content language</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>AddLanguage
|
||
<em>MIME-lang extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr></table>
|
||
|
||
<p>The AddLanguage directive maps the given filename extension
|
||
to the specified content language. <em>MIME-lang</em> is the
|
||
MIME language of filenames containing <em>extension</em>. This
|
||
mapping is added to any already in force, overriding any
|
||
mappings that already exist for the same
|
||
<em>extension</em>.</p>
|
||
|
||
<p>Example:</p>
|
||
|
||
<div class="example"><p><code>
|
||
AddEncoding x-compress .Z<br />
|
||
AddLanguage en .en<br />
|
||
AddLanguage fr .fr
|
||
</code></p></div>
|
||
|
||
<p>Then the document <code>xxxx.en.Z</code> will be treated as
|
||
being a compressed English document (as will the document
|
||
<code>xxxx.Z.en</code>). Although the content language is
|
||
reported to the client, the browser is unlikely to use this
|
||
information. The AddLanguage directive is more useful for <a href="../content-negotiation.html">content negotiation</a>,
|
||
where the server returns one from several documents based on
|
||
the client's language preference.</p>
|
||
|
||
<p>If multiple language assignments are made for the same
|
||
extension, the last one encountered is the one that is used.
|
||
That is, for the case of:</p>
|
||
|
||
<div class="example"><p><code>
|
||
AddLanguage en .en<br />
|
||
AddLanguage en-uk .en<br />
|
||
AddLanguage en-us .en
|
||
</code></p></div>
|
||
|
||
<p>documents with the extension "<code>.en</code>" would be
|
||
treated as being "<code>en-us</code>".</p>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
|
||
<h3>See also</h3><ul><li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddOutputFilter" id="AddOutputFilter">AddOutputFilter</a> <a name="addoutputfilter" id="addoutputfilter">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Maps filename
|
||
extensions to the filters that will process
|
||
responses from the server</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>AddOutputFilter
|
||
<em>filter</em>[<em>;filter</em>...] extension
|
||
[<em>extension</em> ...]</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td /></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>AddOutputFilter
|
||
is only available in Apache 2.0.26 and later.</td></tr></table>
|
||
|
||
<p>The <code class="directive">AddOutputFilter</code> directive maps the
|
||
filename extensions <em>extension</em> to the <a href="../filter.html">filters</a> 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
|
||
<code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code>
|
||
directive. This mapping is merged over any already in force,
|
||
overriding any mappings that already exist for the same
|
||
<em>extension</em>.</p>
|
||
|
||
<p>For example, the following configuration will process all
|
||
.shtml files for server-side includes and will then compress
|
||
the output using <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>.</p>
|
||
|
||
|
||
<div class="example"><p><code>
|
||
AddOutputFilter INCLUDES;DEFLATE shtml
|
||
</code></p></div>
|
||
|
||
<p>If more than one filter is specified, they must be separated
|
||
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>
|
||
|
||
<h3>See also</h3><ul><li><code class="directive"><a href="#removeoutputfilter">RemoveOutputFilter</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddType" id="AddType">AddType</a> <a name="addtype" id="addtype">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Maps the given filename extensions
|
||
onto the specified content type</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>AddType <em>MIME-type
|
||
extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr></table>
|
||
|
||
<p>The AddType directive maps the given filename extensions onto
|
||
the specified content type. <em>MIME-type</em> is the MIME type to
|
||
use for filenames containing <em>extension</em>. This mapping is
|
||
added to any already in force, overriding any mappings that
|
||
already exist for the same <em>extension</em>. This directive can
|
||
be used to add mappings not listed in the MIME types file (see the
|
||
<code class="directive"><a href="#typesconfig">TypesConfig</a></code>
|
||
directive).</p>
|
||
|
||
<p>Example:</p>
|
||
|
||
<div class="example"><p><code>
|
||
AddType image/gif .gif
|
||
</code></p></div>
|
||
|
||
<div class="note">It is recommended that new MIME types be added using the
|
||
AddType directive rather than changing the
|
||
<code class="directive">TypesConfig</code> file. </div>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
|
||
<h3>See also</h3><ul><li><code class="directive"><a href="../mod/core.html#defaulttype">DefaultType</a></code></li><li><code class="directive"><a href="../mod/core.html#forcetype">ForceType</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="DefaultLanguage" id="DefaultLanguage">DefaultLanguage</a> <a name="defaultlanguage" id="defaultlanguage">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Sets all files in the given scope to the
|
||
specified language</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>DefaultLanguage
|
||
<em>MIME-lang</em></code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>DefaultLanguage
|
||
is only available in Apache 1.3.4 and later.</td></tr></table>
|
||
|
||
<p>The DefaultLanguage directive tells Apache that all files in
|
||
the directive's scope (<em>e.g.</em>, all files covered by the
|
||
current <code><Directory></code> container) that don't
|
||
have an explicit language extension (such as <code>.fr</code>
|
||
or <code>.de</code> as configured by <code>AddLanguage</code>)
|
||
should be considered to be in the specified <em>MIME-lang</em>
|
||
language. This allows entire directories to be marked as
|
||
containing Dutch content, for instance, without having to
|
||
rename each file. Note that unlike using extensions to specify
|
||
languages, <code>DefaultLanguage</code> can only specify a
|
||
single language.</p>
|
||
|
||
<p>If no <code>DefaultLanguage</code> directive is in force,
|
||
and a file does not have any language extensions as configured
|
||
by <code>AddLanguage</code>, then that file will be considered
|
||
to have no language attribute.</p>
|
||
|
||
<div class="example"><h3>Example</h3><p><code>
|
||
DefaultLanguage en
|
||
</code></p></div>
|
||
|
||
<h3>See also</h3><ul><li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="ModMimeUsePathInfo" id="ModMimeUsePathInfo">ModMimeUsePathInfo</a> <a name="modmimeusepathinfo" id="modmimeusepathinfo">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Tells mod_mime to treat path_info components as part of the filename</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>ModMimeUsePathInfo On|Off</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>Available in Apache 2.0.41 and later</td></tr></table>
|
||
|
||
<p>The ModMimeUsePathInfo directive is used to combine the filename with
|
||
the path_info URL component to apply mod_mime's directives to the
|
||
request. The default value is 'Off' - therefore, the path_info
|
||
component is ignored.
|
||
</p>
|
||
|
||
<p>This directive is recommended when you have a virtual filesystem.</p>
|
||
|
||
<div class="example"><h3>Example</h3><p><code>
|
||
|
||
ModMimeUsePathInfo On
|
||
</code></p></div>
|
||
|
||
<p>If you have a request for /bar/foo.shtml where /bar is a Location and
|
||
ModMimeUsePathInfo is on, mod_mime will treat the incoming request as
|
||
/bar/foo.shtml and directives like
|
||
<code>AddOutputFilter INCLUDES .shtml</code> will add the INCLUDES
|
||
filter to the request. If ModMimeUsePathInfo is not set, the includes
|
||
filter will not be added.
|
||
</p>
|
||
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="MultiviewsMatch" id="MultiviewsMatch">MultiviewsMatch</a> <a name="multiviewsmatch" id="multiviewsmatch">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>The types of files that will be included when
|
||
searching for a matching file with MultiViews</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>MultiviewsMatch
|
||
<em>[NegotiatedOnly] [Handlers] [Filters] [Any]</em></code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>Available
|
||
in Apache 2.0.26 and later.</td></tr></table>
|
||
|
||
<p>MultiviewsMatch permits three different behaviors for
|
||
<a href="mod_negotiation.html">mod_negotiation</a>'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.</p>
|
||
|
||
<p>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.</p>
|
||
|
||
<p>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.</p>
|
||
|
||
<p>You may finally allow Any 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.</p>
|
||
|
||
<p>For example, the following configuration will allow handlers
|
||
and filters to participate in Multviews, but will exclude unknown
|
||
files:</p>
|
||
<div class="example"><p><code>
|
||
MultiviewsMatch Handlers Filters
|
||
</code></p></div>
|
||
|
||
<h3>See also</h3><ul><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="RemoveCharset" id="RemoveCharset">RemoveCharset</a> <a name="removecharset" id="removecharset">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Removes any character set associations for a set of file
|
||
extensions</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>RemoveCharset
|
||
<em>extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>RemoveCharset is
|
||
only available in Apache 2.0.24 and later.</td></tr></table>
|
||
<p>The <code>RemoveCharset</code> directive removes any
|
||
character set 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>
|
||
|
||
<div class="example"><h3>Example</h3><p><code>
|
||
RemoveCharset .html .shtml
|
||
</code></p></div>
|
||
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="RemoveEncoding" id="RemoveEncoding">RemoveEncoding</a> <a name="removeencoding" id="removeencoding">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Removes any content encoding associations for a set of file
|
||
extensions</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>RemoveEncoding
|
||
<em>extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>RemoveEncoding
|
||
is only available in Apache 1.3.13 and later.</td></tr></table>
|
||
|
||
<p>The <code>RemoveEncoding</code> directive removes any
|
||
encoding 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. An example of its use might be:</p>
|
||
|
||
|
||
<div class="example"><h3>/foo/.htaccess:</h3><pre>
|
||
AddEncoding x-gzip .gz
|
||
AddType text/plain .asc
|
||
<Files *.gz.asc>
|
||
RemoveEncoding .gz
|
||
</Files>
|
||
</pre></div>
|
||
|
||
<p>This will cause <code>foo.gz</code> to be marked as being
|
||
encoded with the gzip method, but <code>foo.gz.asc</code> as an
|
||
unencoded plaintext file.</p>
|
||
|
||
<p><strong>Note:</strong>RemoveEncoding directives are processed
|
||
<em>after</em> any AddEncoding directives, so it is possible they
|
||
may undo the effects of the latter if both occur within the
|
||
same directory configuration.</p>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="RemoveHandler" id="RemoveHandler">RemoveHandler</a> <a name="removehandler" id="removehandler">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Removes any handler associations for a set of file
|
||
extensions</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>RemoveHandler
|
||
<em>extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>RemoveHandler is
|
||
only available in Apache 1.3.4 and later.</td></tr></table>
|
||
|
||
<p>The <code>RemoveHandler</code> directive removes any handler
|
||
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. An example of its use might be:</p>
|
||
|
||
<div class="example"><h3>/foo/.htaccess:</h3><p><code>
|
||
AddHandler server-parsed .html
|
||
</code></p></div>
|
||
|
||
<div class="example"><h3>/foo/bar/.htaccess:</h3><p><code>
|
||
RemoveHandler .html
|
||
</code></p></div>
|
||
|
||
<p>This has the effect of returning <code>.html</code> files in
|
||
the <code>/foo/bar</code> directory to being treated as normal
|
||
files, rather than as candidates for parsing (see the <a href="mod_include.html"><code>mod_include</code></a>
|
||
module).</p>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="RemoveInputFilter" id="RemoveInputFilter">RemoveInputFilter</a> <a name="removeinputfilter" id="removeinputfilter">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Removes any input filter associations for a set of file
|
||
extensions</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>RemoveInputFilter
|
||
<em>extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>RemoveInputFilter is only available in Apache
|
||
2.0.26 and later.</td></tr></table>
|
||
|
||
<p>The <code>RemoveInputFilter</code> 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>
|
||
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="RemoveLanguage" id="RemoveLanguage">RemoveLanguage</a> <a name="removelanguage" id="removelanguage">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Removes any language associations for a set of file
|
||
extensions</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>RemoveLanguage
|
||
<em>extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>RemoveLanguage
|
||
is only available in Apache 2.0.24 and later.</td></tr></table>
|
||
|
||
<p>The <code>RemoveLanguage</code> directive removes any
|
||
language 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>
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="RemoveOutputFilter" id="RemoveOutputFilter">RemoveOutputFilter</a> <a name="removeoutputfilter" id="removeoutputfilter">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Removes any output filter associations for a set of file
|
||
extensions</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>RemoveOutputFilter
|
||
<em>extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td /></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>RemoveOutputFilter is only available in Apache
|
||
2.0.26 and later.</td></tr></table>
|
||
|
||
<p>The <code>RemoveOutputFilter</code> 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>
|
||
|
||
<div class="example"><h3>Example</h3><p><code>
|
||
RemoveOutputFilter shtml
|
||
</code></p></div>
|
||
<h3>See also</h3><ul><li><code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="RemoveType" id="RemoveType">RemoveType</a> <a name="removetype" id="removetype">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>Removes any content type associations for a set of file
|
||
extensions</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>RemoveType
|
||
<em>extension</em> [<em>extension</em>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
|
||
</a></th><td /></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:
|
||
</a></th><td>RemoveType is
|
||
only available in Apache 1.3.13 and later.</td></tr></table>
|
||
<p>The <code class="directive">RemoveType</code> directive removes any MIME type
|
||
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. An example of its use might be:</p>
|
||
|
||
<div class="example"><h3>/foo/.htaccess:</h3><p><code>
|
||
RemoveType .cgi
|
||
</code></p></div>
|
||
|
||
<p>This will remove any special handling of <code>.cgi</code>
|
||
files in the <code>/foo/</code> directory and any beneath it,
|
||
causing the files to be treated as being of the <a href="core.html#defaulttype">default type</a>.</p>
|
||
|
||
<div class="note"><strong>Note:</strong><code class="directive">RemoveType</code> directives
|
||
are processed <em>after</em> any <code class="directive">AddType</code>
|
||
directives, so it is possible they may undo the effects of the
|
||
latter if both occur within the same directory
|
||
configuration.</div>
|
||
|
||
<p>The <em>extension</em> argument is case-insensitive, and can
|
||
be specified with or without a leading dot.</p>
|
||
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="TypesConfig" id="TypesConfig">TypesConfig</a> <a name="typesconfig" id="typesconfig">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
|
||
</a></th><td>The location of the mime.types file</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
|
||
</a></th><td><code>TypesConfig <em>file-path</em></code></td></tr><tr><th><a href="directive-dict.html#Default">Default:
|
||
</a></th><td><code>TypesConfig conf/mime.types</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
|
||
</a></th><td>server config</td></tr><tr><th><a href="directive-dict.html#Status">Status:
|
||
</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
|
||
</a></th><td>mod_mime</td></tr></table>
|
||
|
||
<p>The TypesConfig directive sets the location of the MIME types
|
||
configuration file. <em>Filename</em> is relative to the <a href="core.html#serverroot">ServerRoot</a>. This file sets the
|
||
default list of mappings from filename extensions to content
|
||
types. Most administrators use the provided
|
||
<code>mime.types</code> file, which associates common filename
|
||
extensions with IANA registered content types. The current list is
|
||
maintained at
|
||
<code>http://www.isi.edu/in-notes/iana/assignments/media-types/media-types</code>. This
|
||
simplifies the <code>httpd.conf</code> file by providing the
|
||
majority of media-type definitions, and may be overridden by
|
||
<code class="directive"><a href="#addtype">AddType</a></code> directives as
|
||
needed. You should not edit the <code>mime.types</code> file,
|
||
because it may be replaced when you upgrade your server.</p>
|
||
|
||
<p>The file contains lines in the format of the arguments to
|
||
an <code class="directive"><a href="#addtype">AddType</a></code> directive:</p>
|
||
|
||
<div class="example"><p><code>
|
||
MIME-type extension extension ...
|
||
</code></p></div>
|
||
|
||
<p>
|
||
The case of the extension does not matter. Blank lines, and lines
|
||
beginning with a hash character (`#') are ignored. </p>
|
||
|
||
<div class="note">Please do not send requests to the Apache HTTP Server Project
|
||
to add any new entries in the distributed mime.types file
|
||
unless (1) they are already registered with IANA, and (2) they
|
||
use widely accepted, non-conflicting filename extensions across
|
||
platforms. category/x-subtype requests will be automatically
|
||
rejected, as will any new two-letter extensions as they will
|
||
likely conflict later with the already crowded language and
|
||
character set namespace.</div>
|
||
|
||
<h3>See also</h3><ul><li><code class="module"><a href="../mod/mod_mime_magic.html">mod_mime_magic</a></code></li></ul></div></div><div id="footer"><p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p><p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div></body></html> |