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