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