1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5              This file is generated from xml source: DO NOT EDIT
6        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7      -->
8<title>mod_mime - Apache HTTP Server</title>
9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
12<script src="/style/scripts/prettify.js" type="text/javascript">
13</script>
14
15<link href="/images/favicon.ico" rel="shortcut icon" /></head>
16<body>
17<div id="page-header">
18<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
19<p class="apache">Apache HTTP Server Version 2.2</p>
20<img alt="" src="/images/feather.gif" /></div>
21<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
22<div id="path">
23<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Modules</a></div>
24<div id="page-content">
25<div id="preamble"><h1>Apache Module mod_mime</h1>
26<div class="toplang">
27<p><span>Available Languages: </span><a href="/en/mod/mod_mime.html" title="English">&nbsp;en&nbsp;</a> |
28<a href="/ja/mod/mod_mime.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
29</div>
30<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Associates the requested filename's extensions
31    with the file's behavior (handlers and filters)
32    and content (mime-type, language, character set and
33    encoding)</td></tr>
34<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
35<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>mime_module</td></tr>
36<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_mime.c</td></tr></table>
37<h3>Summary</h3>
38
39    <p>This module is used to associate various bits of "meta
40    information" with files by their filename extensions. This
41    information relates the filename of the document to it's
42    mime-type, language, character set and encoding. This
43    information is sent to the browser, and participates in content
44    negotiation, so the user's preferences are respected when
45    choosing one of several possible files to serve. See
46    <code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code> for more information
47    about <a href="/content-negotiation.html">content negotiation</a>.</p>
48
49    <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
50    extensions onto the meta-information for that file. Respectively
51    they set the character set, content-encoding, content-language,
52    and <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME-type</a> (content-type) of documents.  The directive <code class="directive"><a href="#typesconfig">TypesConfig</a></code> is used to specify a
53    file which also maps extensions onto MIME types. </p>
54
55    <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
56    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
57    or scripts that serve the document.  The <code class="directive"><a href="#multiviewsmatch">MultiviewsMatch</a></code> directive allows
58    <code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code> to consider these file extensions
59    to be included when testing Multiviews matches.</p>
60
61    <p>While <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code> associates meta-information
62    with filename extensions, the <code class="module"><a href="/mod/core.html">core</a></code> server
63    provides directives that are used to associate all the files in a
64    given container (<em>e.g.</em>, <code class="directive"><a href="/mod/core.html#location">&lt;Location&gt;</a></code>, <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code>, or <code class="directive"><a href="/mod/core.html#files">&lt;Files&gt;</a></code>) with particular
65    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
66    override any filename extension mappings defined in
67    <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code>.</p>
68
69    <p>Note that changing the meta-information for a file does not
70    change the value of the <code>Last-Modified</code> header.
71    Thus, previously cached copies may still be used by a client or
72    proxy, with the previous headers. If you change the
73    meta-information (language, content type, character set or
74    encoding) you may need to 'touch' affected files (updating
75    their last modified date) to ensure that all visitors are
76    receive the corrected content headers.</p>
77</div>
78<div id="quickview"><h3 class="directives">Directives</h3>
79<ul id="toc">
80<li><img alt="" src="/images/down.gif" /> <a href="#addcharset">AddCharset</a></li>
81<li><img alt="" src="/images/down.gif" /> <a href="#addencoding">AddEncoding</a></li>
82<li><img alt="" src="/images/down.gif" /> <a href="#addhandler">AddHandler</a></li>
83<li><img alt="" src="/images/down.gif" /> <a href="#addinputfilter">AddInputFilter</a></li>
84<li><img alt="" src="/images/down.gif" /> <a href="#addlanguage">AddLanguage</a></li>
85<li><img alt="" src="/images/down.gif" /> <a href="#addoutputfilter">AddOutputFilter</a></li>
86<li><img alt="" src="/images/down.gif" /> <a href="#addtype">AddType</a></li>
87<li><img alt="" src="/images/down.gif" /> <a href="#defaultlanguage">DefaultLanguage</a></li>
88<li><img alt="" src="/images/down.gif" /> <a href="#modmimeusepathinfo">ModMimeUsePathInfo</a></li>
89<li><img alt="" src="/images/down.gif" /> <a href="#multiviewsmatch">MultiviewsMatch</a></li>
90<li><img alt="" src="/images/down.gif" /> <a href="#removecharset">RemoveCharset</a></li>
91<li><img alt="" src="/images/down.gif" /> <a href="#removeencoding">RemoveEncoding</a></li>
92<li><img alt="" src="/images/down.gif" /> <a href="#removehandler">RemoveHandler</a></li>
93<li><img alt="" src="/images/down.gif" /> <a href="#removeinputfilter">RemoveInputFilter</a></li>
94<li><img alt="" src="/images/down.gif" /> <a href="#removelanguage">RemoveLanguage</a></li>
95<li><img alt="" src="/images/down.gif" /> <a href="#removeoutputfilter">RemoveOutputFilter</a></li>
96<li><img alt="" src="/images/down.gif" /> <a href="#removetype">RemoveType</a></li>
97<li><img alt="" src="/images/down.gif" /> <a href="#typesconfig">TypesConfig</a></li>
98</ul>
99<h3>Topics</h3>
100<ul id="topics">
101<li><img alt="" src="/images/down.gif" /> <a href="#multipleext">Files with Multiple Extensions</a></li>
102<li><img alt="" src="/images/down.gif" /> <a href="#contentencoding">Content encoding</a></li>
103<li><img alt="" src="/images/down.gif" /> <a href="#charset-lang">Character sets and languages</a></li>
104</ul><h3>See also</h3>
105<ul class="seealso">
106<li><code class="directive"><a href="/mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code></li>
107<li><code class="directive"><a href="/mod/core.html#adddefaultcharset">AddDefaultCharset</a></code></li>
108<li><code class="directive"><a href="/mod/core.html#forcetype">ForceType</a></code></li>
109<li><code class="directive"><a href="/mod/core.html#defaulttype">DefaultType</a></code></li>
110<li><code class="directive"><a href="/mod/core.html#sethandler">SetHandler</a></code></li>
111<li><code class="directive"><a href="/mod/core.html#setinputfilter">SetInputFilter</a></code></li>
112<li><code class="directive"><a href="/mod/core.html#setoutputfilter">SetOutputFilter</a></code></li>
113</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
114<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
115<div class="section">
116<h2><a name="multipleext" id="multipleext">Files with Multiple Extensions</a></h2>
117    <p>Files can have more than one extension, and the order of the
118    extensions is <em>normally</em> irrelevant. For example, if the
119    file <code>welcome.html.fr</code> maps onto content type
120    <code>text/html</code> and language French then the file
121    <code>welcome.fr.html</code> will map onto exactly the same
122    information.  If more than one extension is given that maps onto
123    the same type of meta-information, then the one to the right will
124    be used, except for languages and content encodings. For example,
125    if <code>.gif</code> maps to the <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME-type</a>
126    <code>image/gif</code> and <code>.html</code> maps to the
127    MIME-type <code>text/html</code>, then the file
128    <code>welcome.gif.html</code> will be associated with the
129    MIME-type <code>text/html</code>.</p>
130
131    <p><a href="#charset-lang">Languages</a> and <a href="#contentencoding">content encodings</a> are treated accumulative, because one can assign
132    more than one language or encoding to a particular resource. For example,
133    the file <code>welcome.html.en.de</code> will be delivered with
134    <code>Content-Language: en, de</code> and <code>Content-Type:
135    text/html</code>.</p>
136
137    <p>Care should be taken when a file with multiple extensions
138    gets associated with both a <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME-type</a> and a handler. This will
139    usually result in the request being handled by the module associated
140    with the handler. For example, if the <code>.imap</code>
141    extension is mapped to the handler <code>imap-file</code> (from
142    <code class="module"><a href="/mod/mod_imagemap.html">mod_imagemap</a></code>) and the <code>.html</code> extension is
143    mapped to the MIME-type <code>text/html</code>, then the file
144    <code>world.imap.html</code> will be associated with both the
145    <code>imap-file</code> handler and <code>text/html</code> MIME-type.
146    When it is processed, the <code>imap-file</code> handler will be used,
147    and so it will be treated as a <code class="module"><a href="/mod/mod_imagemap.html">mod_imagemap</a></code> imagemap
148    file.</p>
149
150    <p>If you would prefer only the last dot-separated part of the
151    filename to be mapped to a particular piece of meta-data, then do
152    not use the <code>Add*</code> directives. For example, if you wish
153    to have the file <code>foo.html.cgi</code> processed as a CGI
154    script, but not the file <code>bar.cgi.html</code>, then instead
155    of using <code>AddHandler cgi-script .cgi</code>, use</p>
156
157    <div class="example"><h3>Configure handler based on final extension only</h3><p><code>
158    &lt;FilesMatch \.cgi$&gt;
159    <span class="indent">
160      SetHandler cgi-script
161    </span>
162    &lt;/FilesMatch&gt;
163    </code></p></div>
164
165</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
166<div class="section">
167<h2><a name="contentencoding" id="contentencoding">Content encoding</a></h2>
168    <p>A file of a particular <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME-type</a> can additionally be encoded a
169    particular way to simplify transmission over the Internet.
170    While this usually will refer to compression, such as
171    <code>gzip</code>, it can also refer to encryption, such a
172    <code>pgp</code> or to an encoding such as UUencoding, which is
173    designed for transmitting a binary file in an ASCII (text)
174    format.</p>
175
176    <p>The <a href="http://www.ietf.org/rfc/rfc2616.txt">HTTP/1.1
177    RFC</a>, section 14.11 puts it this way:</p>
178
179    <blockquote cite="http://www.ietf.org/rfc/rfc2616.txt">
180      <p>The Content-Encoding entity-header field is used as a modifier to
181      the media-type. When present, its value indicates what additional
182      content codings have been applied to the entity-body, and thus what
183      decoding mechanisms must be applied in order to obtain the media-type
184      referenced by the Content-Type header field. Content-Encoding is
185      primarily used to allow a document to be compressed without losing
186      the identity of its underlying media type.</p>
187    </blockquote>
188
189    <p>By using more than one file extension (see <a href="#multipleext">section above about multiple file
190    extensions</a>), you can indicate that a file is of a
191    particular <em>type</em>, and also has a particular
192    <em>encoding</em>. </p>
193
194    <p>For example, you may have a file which is a Microsoft Word
195    document, which is pkzipped to reduce its size. If the
196    <code>.doc</code> extension is associated with the Microsoft
197    Word file type, and the <code>.zip</code> extension is
198    associated with the pkzip file encoding, then the file
199    <code>Resume.doc.zip</code> would be known to be a pkzip'ed Word
200    document.</p>
201
202    <p>Apache sends a <code>Content-encoding</code> header with the
203    resource, in order to tell the client browser about the
204    encoding method.</p>
205
206    <div class="example"><p><code>Content-encoding: pkzip</code></p></div>
207</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
208<div class="section">
209<h2><a name="charset-lang" id="charset-lang">Character sets and languages</a></h2>
210    <p>In addition to file type and the file encoding,
211    another important piece of information is what language a
212    particular document is in, and in what character set the file
213    should be displayed. For example, the document might be written
214    in the Vietnamese alphabet, or in Cyrillic, and should be
215    displayed as such. This information, also, is transmitted in
216    HTTP headers.</p>
217
218    <p>The character set, language, encoding and mime type are all 
219    used in the process of content negotiation (See 
220    <code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code>) to determine
221    which document to give to the client, when there are
222    alternative documents in more than one character set, language, 
223    encoding or mime type. All filename extensions associations
224    created with <code class="directive"><a href="#addcharset">AddCharset</a></code>,
225    <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> directives
226    (and extensions listed in the <code class="directive"><a href="/mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code>) participate in this select process.
227    Filename extensions that are only associated using the <code class="directive"><a href="#addhandler">AddHandler</a></code>, <code class="directive"><a href="#addinputfilter">AddInputFilter</a></code> or <code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code> directives may be included or excluded
228    from matching by using the <code class="directive"><a href="#multiviewsmatch">MultiviewsMatch</a></code> directive.</p>
229
230    <h3><a name="charset" id="charset">Charset</a></h3>
231      <p>To convey this further information, Apache optionally sends
232      a <code>Content-Language</code> header, to specify the language
233      that the document is in, and can append additional information
234      onto the <code>Content-Type</code> header to indicate the
235      particular character set that should be used to correctly
236      render the information.</p>
237
238      <div class="example"><p><code>
239        Content-Language: en, fr<br />
240	Content-Type: text/plain; charset=ISO-8859-1
241      </code></p></div>
242
243      <p>The language specification is the two-letter abbreviation
244      for the language. The <code>charset</code> is the name of the
245      particular character set which should be used.</p>
246    
247</div>
248<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
249<div class="directive-section"><h2><a name="AddCharset" id="AddCharset">AddCharset</a> <a name="addcharset" id="addcharset">Directive</a></h2>
250<table class="directive">
251<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extensions to the specified content
252charset</td></tr>
253<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddCharset <var>charset</var> <var>extension</var>
254[<var>extension</var>] ...</code></td></tr>
255<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
256<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
257<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
258<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
259</table>
260    <p>The <code class="directive">AddCharset</code> directive maps the given
261    filename extensions to the specified content charset. <var>charset</var>
262    is the <a href="http://www.iana.org/assignments/character-sets">MIME
263    charset parameter</a> of filenames containing
264    <var>extension</var>. This mapping is added to any already in force,
265    overriding any mappings that already exist for the same
266    <var>extension</var>.</p>
267
268    <div class="example"><h3>Example</h3><p><code>
269      AddLanguage ja .ja<br />
270      AddCharset EUC-JP .euc<br />
271      AddCharset ISO-2022-JP .jis<br />
272      AddCharset SHIFT_JIS .sjis
273    </code></p></div>
274
275    <p>Then the document <code>xxxx.ja.jis</code> will be treated
276    as being a Japanese document whose charset is <code>ISO-2022-JP</code>
277    (as will the document <code>xxxx.jis.ja</code>). The
278    <code class="directive">AddCharset</code> directive is useful for both to
279    inform the client about the character encoding of the document so that
280    the document can be interpreted and displayed appropriately, and for <a href="/content-negotiation.html">content negotiation</a>,
281    where the server returns one from several documents based on
282    the client's charset preference.</p>
283
284    <p>The <var>extension</var> argument is case-insensitive and can
285    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
286    <var>extension</var> argument will be compared against each of
287    them.</p>
288
289
290<h3>See also</h3>
291<ul>
292<li><code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code></li>
293<li><code class="directive"><a href="/mod/core.html#adddefaultcharset">AddDefaultCharset</a></code></li>
294</ul>
295</div>
296<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
297<div class="directive-section"><h2><a name="AddEncoding" id="AddEncoding">AddEncoding</a> <a name="addencoding" id="addencoding">Directive</a></h2>
298<table class="directive">
299<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extensions to the specified encoding
300type</td></tr>
301<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddEncoding <var>MIME-enc</var> <var>extension</var>
302[<var>extension</var>] ...</code></td></tr>
303<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
304<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
305<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
306<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
307</table>
308    <p>The <code class="directive">AddEncoding</code> directive maps the given
309    filename extensions to the specified encoding type. <var>MIME-enc</var>
310    is the MIME encoding to use for documents containing the
311    <var>extension</var>. This mapping is added to any already in force,
312    overriding any mappings that already exist for the same
313    <var>extension</var>.</p>
314
315    <div class="example"><h3>Example</h3><p><code>
316      AddEncoding x-gzip .gz<br />
317      AddEncoding x-compress .Z
318    </code></p></div>
319
320    <p>This will cause filenames containing the <code>.gz</code> extension
321    to be marked as encoded using the <code>x-gzip</code> encoding, and
322    filenames containing the <code>.Z</code> extension to be marked as
323    encoded with <code>x-compress</code>.</p>
324
325    <p>Old clients expect <code>x-gzip</code> and <code>x-compress</code>,
326    however the standard dictates that they're equivalent to
327    <code>gzip</code> and <code>compress</code> respectively. Apache does
328    content encoding comparisons by ignoring any leading <code>x-</code>.
329    When responding with an encoding Apache will use whatever form
330    (<em>i.e.</em>, <code>x-foo</code> or <code>foo</code>) the
331    client requested. If the client didn't specifically request a
332    particular form Apache will use the form given by the
333    <code>AddEncoding</code> directive. To make this long story
334    short, you should always use <code>x-gzip</code> and
335    <code>x-compress</code> for these two specific encodings. More
336    recent encodings, such as <code>deflate</code> should be
337    specified without the <code>x-</code>.</p>
338
339    <p>The <var>extension</var> argument is case-insensitive and can
340    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
341    <var>extension</var> argument will be compared against each of
342    them.</p>
343
344</div>
345<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
346<div class="directive-section"><h2><a name="AddHandler" id="AddHandler">AddHandler</a> <a name="addhandler" id="addhandler">Directive</a></h2>
347<table class="directive">
348<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the filename extensions to the specified
349handler</td></tr>
350<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddHandler <var>handler-name</var> <var>extension</var>
351[<var>extension</var>] ...</code></td></tr>
352<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
353<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
354<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
355<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
356</table>
357    <p>Files having the name <var>extension</var> will be served by the
358    specified <var><a href="/handler.html">handler-name</a></var>. This
359    mapping is added to any already in force, overriding any mappings that
360    already exist for the same <var>extension</var>. For example, to
361    activate CGI scripts with the file extension <code>.cgi</code>, you
362    might use:</p>
363
364    <div class="example"><p><code>
365      AddHandler cgi-script .cgi
366    </code></p></div>
367
368    <p>Once that has been put into your httpd.conf file, any file containing
369    the <code>.cgi</code> extension will be treated as a CGI program.</p>
370
371    <p>The <var>extension</var> argument is case-insensitive and can
372    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
373    <var>extension</var> argument will be compared against each of
374    them.</p>
375
376<h3>See also</h3>
377<ul>
378<li><code class="directive"><a href="/mod/core.html#sethandler">SetHandler</a></code></li>
379</ul>
380</div>
381<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
382<div class="directive-section"><h2><a name="AddInputFilter" id="AddInputFilter">AddInputFilter</a> <a name="addinputfilter" id="addinputfilter">Directive</a></h2>
383<table class="directive">
384<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps filename extensions to the filters that will process
385client requests</td></tr>
386<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddInputFilter <var>filter</var>[;<var>filter</var>...]
387<var>extension</var> [<var>extension</var>] ...</code></td></tr>
388<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
389<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
390<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
391<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
392<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>AddInputFilter is only available in Apache 2.0.26 and
393later.</td></tr>
394</table>
395    <p><code class="directive">AddInputFilter</code> maps the filename extension
396    <var>extension</var> to the <a href="/filter.html">filters</a> which
397    will process client requests and POST input when they are received by
398    the server. This is in addition to any filters defined elsewhere,
399    including the <code class="directive"><a href="/mod/core.html#setinputfilter">SetInputFilter</a></code>
400    directive. This mapping is merged over any already in force, overriding
401    any mappings that already exist for the same <var>extension</var>.</p>
402
403    <p>If more than one <var>filter</var> is specified, they must be separated
404    by semicolons in the order in which they should process the
405    content. The <var>filter</var> is case-insensitive.</p>
406
407    <p>The <var>extension</var> argument is case-insensitive and can
408    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
409    <var>extension</var> argument will be compared against each of
410    them.</p>
411
412
413<h3>See also</h3>
414<ul>
415<li><code class="directive"><a href="#removeinputfilter">RemoveInputFilter</a></code></li>
416<li><code class="directive"><a href="/mod/core.html#setinputfilter">SetInputFilter</a></code></li>
417</ul>
418</div>
419<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
420<div class="directive-section"><h2><a name="AddLanguage" id="AddLanguage">AddLanguage</a> <a name="addlanguage" id="addlanguage">Directive</a></h2>
421<table class="directive">
422<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extension to the specified content
423language</td></tr>
424<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddLanguage <var>MIME-lang</var> <var>extension</var>
425[<var>extension</var>] ...</code></td></tr>
426<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
427<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
428<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
429<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
430</table>
431    <p>The <code class="directive">AddLanguage</code> directive maps the given
432    filename extension to the specified content language.
433    <var>MIME-lang</var> is the MIME language of filenames containing
434    <var>extension</var>. This mapping is added to any already in force,
435    overriding any mappings that already exist for the same
436    <var>extension</var>.</p>
437
438    <div class="example"><h3>Example</h3><p><code>
439      AddEncoding x-compress .Z<br />
440      AddLanguage en .en<br />
441      AddLanguage fr .fr
442    </code></p></div>
443
444    <p>Then the document <code>xxxx.en.Z</code> will be treated as
445    being a compressed English document (as will the document
446    <code>xxxx.Z.en</code>). Although the content language is
447    reported to the client, the browser is unlikely to use this
448    information. The <code class="directive">AddLanguage</code> directive is
449    more useful for <a href="/content-negotiation.html">content
450    negotiation</a>, where the server returns one from several documents
451    based on the client's language preference.</p>
452
453    <p>If multiple language assignments are made for the same
454    extension, the last one encountered is the one that is used.
455    That is, for the case of:</p>
456
457    <div class="example"><p><code>
458      AddLanguage en .en<br />
459      AddLanguage en-gb .en<br />
460      AddLanguage en-us .en
461    </code></p></div>
462
463    <p>documents with the extension <code>.en</code> would be treated as
464    being <code>en-us</code>.</p>
465
466    <p>The <var>extension</var> argument is case-insensitive and can
467    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
468    <var>extension</var> argument will be compared against each of
469    them.</p>
470
471<h3>See also</h3>
472<ul>
473<li><code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code></li>
474</ul>
475</div>
476<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
477<div class="directive-section"><h2><a name="AddOutputFilter" id="AddOutputFilter">AddOutputFilter</a> <a name="addoutputfilter" id="addoutputfilter">Directive</a></h2>
478<table class="directive">
479<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps filename extensions to the filters that will process
480responses from the server</td></tr>
481<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilter <var>filter</var>[;<var>filter</var>...]
482<var>extension</var> [<var>extension</var>] ...</code></td></tr>
483<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
484<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
485<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
486<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
487<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>AddOutputFilter is only available in Apache 2.0.26 and
488later.</td></tr>
489</table>
490    <p>The <code class="directive">AddOutputFilter</code> directive maps the
491    filename extension <var>extension</var> to the <a href="/filter.html">filters</a> which will process responses
492    from the server before they are sent to the client. This is in
493    addition to any filters defined elsewhere, including <code class="directive"><a href="/mod/core.html#setoutputfilter">SetOutputFilter</a></code> and <code class="directive"><a href="/mod/core.html#addoutputfilterbytype">AddOutputFilterByType</a></code> directive. This mapping is merged
494    over any already in force, overriding any mappings that already exist
495    for the same <var>extension</var>.</p>
496
497    <p>For example, the following configuration will process all
498    <code>.shtml</code> files for server-side includes and will then
499    compress the output using <code class="module"><a href="/mod/mod_deflate.html">mod_deflate</a></code>.</p>
500
501    <div class="example"><p><code>
502      AddOutputFilter INCLUDES;DEFLATE shtml
503    </code></p></div>
504
505    <p>If more than one filter is specified, they must be separated
506    by semicolons in the order in which they should process the
507    content. The <var>filter</var> argument is case-insensitive.</p>
508
509    <p>The <var>extension</var> argument is case-insensitive and can
510    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
511    <var>extension</var> argument will be compared against each of
512    them.</p>
513
514<h3>See also</h3>
515<ul>
516<li><code class="directive"><a href="#removeoutputfilter">RemoveOutputFilter</a></code></li>
517<li><code class="directive"><a href="/mod/core.html#setoutputfilter">SetOutputFilter</a></code></li>
518</ul>
519</div>
520<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
521<div class="directive-section"><h2><a name="AddType" id="AddType">AddType</a> <a name="addtype" id="addtype">Directive</a></h2>
522<table class="directive">
523<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extensions onto the specified content
524type</td></tr>
525<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddType <var>MIME-type</var> <var>extension</var>
526[<var>extension</var>] ...</code></td></tr>
527<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
528<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
529<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
530<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
531</table>
532    <p>The <code class="directive">AddType</code> directive maps the given
533    filename extensions onto the specified content
534    type. <var>MIME-type</var> is the <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME
535    type</a> to use for filenames containing
536    <var>extension</var>. This mapping is added to any already in
537    force, overriding any mappings that already exist for the same
538    <var>extension</var>. This directive can be used to add mappings
539    not listed in the MIME types file (see the <code class="directive"><a href="#typesconfig">TypesConfig</a></code> directive).</p>
540    
541    <div class="example"><h3>Example</h3><p><code>
542      AddType image/gif .gif
543    </code></p></div>
544
545    <div class="note">
546      It is recommended that new MIME types be added using the
547      <code class="directive">AddType</code> directive rather than changing the 
548      <code class="directive"><a href="#typesconfig">TypesConfig</a></code> file.
549    </div>
550
551    <p>The <var>extension</var> argument is case-insensitive and can
552    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
553    <var>extension</var> argument will be compared against each of
554    them.</p>
555
556<h3>See also</h3>
557<ul>
558<li><code class="directive"><a href="/mod/core.html#defaulttype">DefaultType</a></code></li>
559<li><code class="directive"><a href="/mod/core.html#forcetype">ForceType</a></code></li>
560</ul>
561</div>
562<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
563<div class="directive-section"><h2><a name="DefaultLanguage" id="DefaultLanguage">DefaultLanguage</a> <a name="defaultlanguage" id="defaultlanguage">Directive</a></h2>
564<table class="directive">
565<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets all files in the given scope to the specified
566language</td></tr>
567<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultLanguage <var>MIME-lang</var></code></td></tr>
568<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
569<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
570<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
571<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
572</table>
573    <p>The <code class="directive">DefaultLanguage</code> directive tells Apache
574    that all files in the directive's scope (<em>e.g.</em>, all files
575    covered by the current <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code> container) that don't have an explicit language
576    extension (such as <code>.fr</code> or <code>.de</code> as configured
577    by <code class="directive"><a href="#addlanguage">AddLanguage</a></code>) should be
578    considered to be in the specified <var>MIME-lang</var> language. This
579    allows entire directories to be marked as containing Dutch content, for
580    instance, without having to rename each file. Note that unlike using
581    extensions to specify languages, <code class="directive">DefaultLanguage</code>
582    can only specify a single language.</p>
583
584    <p>If no <code class="directive">DefaultLanguage</code> directive is in force,
585    and a file does not have any language extensions as configured
586    by <code class="directive"><a href="#addlanguage">AddLanguage</a></code>, then that file
587    will be considered to have no language attribute.</p>
588
589    <div class="example"><h3>Example</h3><p><code>
590      DefaultLanguage en
591    </code></p></div>
592
593<h3>See also</h3>
594<ul>
595<li><code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code></li>
596</ul>
597</div>
598<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
599<div class="directive-section"><h2><a name="ModMimeUsePathInfo" id="ModMimeUsePathInfo">ModMimeUsePathInfo</a> <a name="modmimeusepathinfo" id="modmimeusepathinfo">Directive</a></h2>
600<table class="directive">
601<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Tells <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code> to treat <code>path_info</code>
602components as part of the filename</td></tr>
603<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ModMimeUsePathInfo On|Off</code></td></tr>
604<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ModMimeUsePathInfo Off</code></td></tr>
605<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
606<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
607<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
608<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.41 and later</td></tr>
609</table>
610    <p>The <code class="directive">ModMimeUsePathInfo</code> directive is used to
611    combine the filename with the <code>path_info</code> URL component to
612    apply <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code>'s directives to the request. The default
613    value is <code>Off</code> - therefore, the <code>path_info</code>
614    component is ignored.</p>
615
616    <p>This directive is recommended when you have a virtual filesystem.</p>
617
618    <div class="example"><h3>Example</h3><p><code>
619      ModMimeUsePathInfo On
620    </code></p></div>
621
622    <p>If you have a request for <code>/bar/foo.shtml</code> where
623    <code>/bar</code> is a Location and <code class="directive">ModMimeUsePathInfo</code> is <code>On</code>,
624    <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code> will treat the incoming request as
625    <code>/bar/foo.shtml</code> and directives like <code>AddOutputFilter
626    INCLUDES .shtml</code> will add the <code>INCLUDES</code> filter to the
627    request. If <code class="directive">ModMimeUsePathInfo</code> is not set, the
628    <code>INCLUDES</code> filter will not be added.</p>
629
630<h3>See also</h3>
631<ul>
632<li><code class="directive"><a href="/mod/core.html#acceptpathinfo">AcceptPathInfo</a></code></li>
633</ul>
634</div>
635<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
636<div class="directive-section"><h2><a name="MultiviewsMatch" id="MultiviewsMatch">MultiviewsMatch</a> <a name="multiviewsmatch" id="multiviewsmatch">Directive</a></h2>
637<table class="directive">
638<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The types of files that will be included when searching for
639a matching file with MultiViews</td></tr>
640<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MultiviewsMatch Any|NegotiatedOnly|Filters|Handlers
641[Handlers|Filters]</code></td></tr>
642<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MultiviewsMatch NegotiatedOnly</code></td></tr>
643<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
644<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
645<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
646<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
647<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.26 and later.</td></tr>
648</table>
649    <p><code class="directive">MultiviewsMatch</code> permits three different
650    behaviors for <a href="mod_negotiation.html">mod_negotiation</a>'s
651    Multiviews feature.  Multiviews allows a request for a file,
652    <em>e.g.</em> <code>index.html</code>, to match any negotiated
653    extensions following the base request, <em>e.g.</em>
654    <code>index.html.en</code>, <code>index.html.fr</code>, or
655    <code>index.html.gz</code>.</p>
656
657    <p>The <code>NegotiatedOnly</code> option provides that every extension
658    following the base name must correlate to a recognized
659    <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code> extension for content negotiation, <em>e.g.</em>
660    Charset, Content-Type, Language, or Encoding.  This is the strictest
661    implementation with the fewest unexpected side effects, and is the
662    default behavior.</p>
663
664    <p>To include extensions associated with Handlers and/or Filters,
665    set the <code class="directive">MultiviewsMatch</code> directive to either
666    <code>Handlers</code>, <code>Filters</code>, or both option keywords.
667    If all other factors are equal, the smallest file will be served,
668    <em>e.g.</em> in deciding between <code>index.html.cgi</code> of 500
669    bytes and <code>index.html.pl</code> of 1000 bytes, the <code>.cgi</code>
670    file would win in this example. Users of <code>.asis</code> files
671    might prefer to use the Handler option, if <code>.asis</code> files are
672    associated with the <code>asis-handler</code>.</p>
673
674    <p>You may finally allow <code>Any</code> extensions to match, even if
675    <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code> doesn't recognize the extension. This was the
676    behavior in Apache 1.3, and can cause unpredictable results, such as
677    serving .old or .bak files the webmaster never expected to be served.</p>
678
679    <p>For example, the following configuration will allow handlers
680    and filters to participate in Multviews, but will exclude unknown
681    files:</p>
682
683    <div class="example"><p><code>
684      MultiviewsMatch Handlers Filters
685    </code></p></div>
686
687    <p><code class="directive">MultiviewsMatch</code> is not allowed in a
688    <code class="directive"><a href="/mod/core.html#location">&lt;Location&gt;</a></code> or <code class="directive"><a href="/mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code> section.</p>
689
690
691<h3>See also</h3>
692<ul>
693<li><code class="directive"><a href="/mod/core.html#options">Options</a></code></li>
694<li><code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code></li>
695</ul>
696</div>
697<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
698<div class="directive-section"><h2><a name="RemoveCharset" id="RemoveCharset">RemoveCharset</a> <a name="removecharset" id="removecharset">Directive</a></h2>
699<table class="directive">
700<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any character set associations for a set of file
701extensions</td></tr>
702<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveCharset <var>extension</var> [<var>extension</var>]
703...</code></td></tr>
704<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
705<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
706<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
707<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
708<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>RemoveCharset is only available in Apache 2.0.24 and
709later.</td></tr>
710</table>
711    <p>The <code class="directive">RemoveCharset</code> directive removes any
712    character set associations for files with the given extensions.
713    This allows <code>.htaccess</code> files in subdirectories to
714    undo any associations inherited from parent directories or the
715    server config files.</p>
716
717    <p>The <var>extension</var> argument is case-insensitive and can
718    be specified with or without a leading dot.</p>
719
720    <div class="example"><h3>Example</h3><p><code>
721      RemoveCharset .html .shtml
722    </code></p></div>
723
724</div>
725<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
726<div class="directive-section"><h2><a name="RemoveEncoding" id="RemoveEncoding">RemoveEncoding</a> <a name="removeencoding" id="removeencoding">Directive</a></h2>
727<table class="directive">
728<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any content encoding associations for a set of file
729extensions</td></tr>
730<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveEncoding <var>extension</var> [<var>extension</var>]
731...</code></td></tr>
732<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
733<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
734<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
735<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
736</table>
737    <p>The <code class="directive">RemoveEncoding</code> directive removes any
738    encoding associations for files with the given extensions. This
739    allows <code>.htaccess</code> files in subdirectories to undo
740    any associations inherited from parent directories or the
741    server config files. An example of its use might be:</p>
742
743    <div class="example"><h3>/foo/.htaccess:</h3><p><code>
744      AddEncoding x-gzip .gz<br />
745      AddType text/plain .asc<br />
746      &lt;Files *.gz.asc&gt;<br />
747      <span class="indent">
748        RemoveEncoding .gz<br />
749      </span>
750      &lt;/Files&gt;
751    </code></p></div>
752
753    <p>This will cause <code>foo.gz</code> to be marked as being
754    encoded with the gzip method, but <code>foo.gz.asc</code> as an
755    unencoded plaintext file.</p>
756
757    <div class="note"><h3>Note</h3>
758      <p><code class="directive">RemoveEncoding</code> directives are processed
759      <em>after</em> any <code class="directive"><a href="#addencoding">AddEncoding</a></code>
760      directives, so it is possible they may undo the effects of the latter
761      if both occur within the same directory configuration.</p>
762    </div>
763
764    <p>The <var>extension</var> argument is case-insensitive and can
765    be specified with or without a leading dot.</p>
766
767</div>
768<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
769<div class="directive-section"><h2><a name="RemoveHandler" id="RemoveHandler">RemoveHandler</a> <a name="removehandler" id="removehandler">Directive</a></h2>
770<table class="directive">
771<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any handler associations for a set of file
772extensions</td></tr>
773<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveHandler <var>extension</var> [<var>extension</var>]
774...</code></td></tr>
775<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
776<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
777<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
778<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
779</table>
780    <p>The <code class="directive">RemoveHandler</code> directive removes any
781    handler associations for files with the given extensions. This allows
782    <code>.htaccess</code> files in subdirectories to undo any
783    associations inherited from parent directories or the server
784    config files. An example of its use might be:</p>
785
786    <div class="example"><h3>/foo/.htaccess:</h3><p><code>
787      AddHandler server-parsed .html
788    </code></p></div>
789
790    <div class="example"><h3>/foo/bar/.htaccess:</h3><p><code>
791      RemoveHandler .html
792    </code></p></div>
793
794    <p>This has the effect of returning <code>.html</code> files in
795    the <code>/foo/bar</code> directory to being treated as normal
796    files, rather than as candidates for parsing (see the <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> module).</p>
797
798    <p>The <var>extension</var> argument is case-insensitive and can
799    be specified with or without a leading dot.</p>
800
801</div>
802<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
803<div class="directive-section"><h2><a name="RemoveInputFilter" id="RemoveInputFilter">RemoveInputFilter</a> <a name="removeinputfilter" id="removeinputfilter">Directive</a></h2>
804<table class="directive">
805<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any input filter associations for a set of file
806extensions</td></tr>
807<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveInputFilter <var>extension</var> [<var>extension</var>]
808...</code></td></tr>
809<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
810<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
811<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
812<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
813<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>RemoveInputFilter is only available in Apache 2.0.26 and
814later.</td></tr>
815</table>   
816    <p>The <code class="directive">RemoveInputFilter</code> directive removes any
817    input <a href="/filter.html">filter</a> associations for files with
818    the given extensions.
819    This allows <code>.htaccess</code> files in subdirectories to
820    undo any associations inherited from parent directories or the
821    server config files.</p>
822
823    <p>The <var>extension</var> argument is case-insensitive and can
824    be specified with or without a leading dot.</p>
825
826<h3>See also</h3>
827<ul>
828<li><code class="directive"><a href="#addinputfilter">AddInputFilter</a></code></li>
829<li><code class="directive"><a href="/mod/core.html#setinputfilter">SetInputFilter</a></code></li>
830</ul>
831</div>
832<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
833<div class="directive-section"><h2><a name="RemoveLanguage" id="RemoveLanguage">RemoveLanguage</a> <a name="removelanguage" id="removelanguage">Directive</a></h2>
834<table class="directive">
835<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any language associations for a set of file
836extensions</td></tr>
837<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveLanguage <var>extension</var> [<var>extension</var>]
838...</code></td></tr>
839<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
840<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
841<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
842<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
843<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>RemoveLanguage is only available in Apache 2.0.24 and
844later.</td></tr>
845</table>
846    <p>The <code class="directive">RemoveLanguage</code> directive removes any
847    language associations for files with the given extensions. This
848    allows <code>.htaccess</code> files in subdirectories to undo
849    any associations inherited from parent directories or the
850    server config files.</p>
851
852    <p>The <var>extension</var> argument is case-insensitive and can
853    be specified with or without a leading dot.</p>
854
855</div>
856<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
857<div class="directive-section"><h2><a name="RemoveOutputFilter" id="RemoveOutputFilter">RemoveOutputFilter</a> <a name="removeoutputfilter" id="removeoutputfilter">Directive</a></h2>
858<table class="directive">
859<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any output filter associations for a set of file
860extensions</td></tr>
861<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveOutputFilter <var>extension</var> [<var>extension</var>]
862...</code></td></tr>
863<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
864<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
865<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
866<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
867<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>RemoveOutputFilter is only available in Apache 2.0.26 and
868later.</td></tr>
869</table>    
870    <p>The <code class="directive">RemoveOutputFilter</code> directive removes any
871    output <a href="/filter.html">filter</a> associations for files with
872    the given extensions.
873    This allows <code>.htaccess</code> files in subdirectories to
874    undo any associations inherited from parent directories or the
875    server config files.</p>
876
877    <p>The <var>extension</var> argument is case-insensitive and can
878    be specified with or without a leading dot.</p>
879
880    <div class="example"><h3>Example</h3><p><code>
881      RemoveOutputFilter shtml
882    </code></p></div>
883
884<h3>See also</h3>
885<ul>
886<li><code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code></li>
887</ul>
888</div>
889<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
890<div class="directive-section"><h2><a name="RemoveType" id="RemoveType">RemoveType</a> <a name="removetype" id="removetype">Directive</a></h2>
891<table class="directive">
892<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any content type associations for a set of file
893extensions</td></tr>
894<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveType <var>extension</var> [<var>extension</var>]
895...</code></td></tr>
896<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
897<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
898<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
899<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
900</table>
901    <p>The <code class="directive">RemoveType</code> directive removes any
902    <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME type</a> associations for files with
903    the given extensions. This allows <code>.htaccess</code> files in
904    subdirectories to undo any associations inherited from parent
905    directories or the server config files. An example of its use
906    might be:</p>
907
908    <div class="example"><h3>/foo/.htaccess:</h3><p><code>
909      RemoveType .cgi
910    </code></p></div>
911
912    <p>This will remove any special handling of <code>.cgi</code>
913    files in the <code>/foo/</code> directory and any beneath it,
914    causing the files to be treated as being of the <code class="directive"><a href="/mod/core.html#defaulttype">DefaultType</a></code>.</p>
915
916    <div class="note"><h3>Note</h3>
917      <p><code class="directive">RemoveType</code> directives are processed
918      <em>after</em> any <code class="directive"><a href="#addtype">AddType</a></code>
919      directives, so it is possible they may undo the effects of the
920      latter if both occur within the same directory configuration.</p>
921    </div>
922
923    <p>The <var>extension</var> argument is case-insensitive and can
924    be specified with or without a leading dot.</p>
925
926</div>
927<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
928<div class="directive-section"><h2><a name="TypesConfig" id="TypesConfig">TypesConfig</a> <a name="typesconfig" id="typesconfig">Directive</a></h2>
929<table class="directive">
930<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The location of the <code>mime.types</code> file</td></tr>
931<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TypesConfig <var>file-path</var></code></td></tr>
932<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TypesConfig conf/mime.types</code></td></tr>
933<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
934<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
935<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
936</table>
937    <p>The <code class="directive">TypesConfig</code> directive sets the
938    location of the <a class="glossarylink" href="/glossary.html#mime-type" title="see glossary">MIME types</a>
939    configuration file. <var>File-path</var> is relative to the
940    <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code>. This file sets
941    the default list of mappings from filename extensions to content
942    types. Most administrators use the provided
943    <code>mime.types</code> file, which associates common filename
944    extensions with IANA registered content types. The current list is
945    maintained at <a href="http://www.iana.org/assignments/media-types/index.html">http://www.iana.org/assignments/media-types/index.html</a>.  This
946    simplifies the <code>httpd.conf</code> file by providing the
947    majority of media-type definitions, and may be overridden by
948    <code class="directive"><a href="#addtype">AddType</a></code> directives as
949    needed. You should not edit the <code>mime.types</code> file,
950    because it may be replaced when you upgrade your server.</p>
951
952    <p>The file contains lines in the format of the arguments to
953    an <code class="directive"><a href="#addtype">AddType</a></code> directive:</p>
954
955    <div class="example"><p><code>
956      <var>MIME-type</var> [<var>extension</var>] ...
957    </code></p></div>
958
959    <p>The case of the extension does not matter. Blank lines, and lines
960    beginning with a hash character (<code>#</code>) are ignored.</p>
961
962    <div class="note">
963      Please do <strong>not</strong> send requests to the Apache HTTP
964      Server Project to add any new entries in the distributed
965      <code>mime.types</code> file unless (1) they are already
966      registered with IANA, and (2) they use widely accepted,
967      non-conflicting filename extensions across platforms.
968      <code>category/x-subtype</code> requests will be automatically
969      rejected, as will any new two-letter extensions as they will
970      likely conflict later with the already crowded language and
971      character set namespace.
972    </div>
973
974<h3>See also</h3>
975<ul>
976<li><code class="module"><a href="/mod/mod_mime_magic.html">mod_mime_magic</a></code></li>
977</ul>
978</div>
979</div>
980<div class="bottomlang">
981<p><span>Available Languages: </span><a href="/en/mod/mod_mime.html" title="English">&nbsp;en&nbsp;</a> |
982<a href="/ja/mod/mod_mime.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
983</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
984<script type="text/javascript"><!--//--><![CDATA[//><!--
985var comments_shortname = 'httpd';
986var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_mime.html';
987(function(w, d) {
988    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
989        d.write('<div id="comments_thread"><\/div>');
990        var s = d.createElement('script');
991        s.type = 'text/javascript';
992        s.async = true;
993        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
994        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
995    }
996    else { 
997        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
998    }
999})(window, document);
1000//--><!]]></script></div><div id="footer">
1001<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
1002<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
1003if (typeof(prettyPrint) !== 'undefined') {
1004    prettyPrint();
1005}
1006//--><!]]></script>
1007</body></html>