]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_mime.html
tidy -mi -asxhtml (w3c tidy)
[apache] / docs / manual / mod / mod_mime.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml">
5   <head>
6     <meta name="generator" content="HTML Tidy, see www.w3.org" />
7
8     <title>Apache module mod_mime</title>
9   </head>
10   <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
11
12   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
13   vlink="#000080" alink="#FF0000">
14     <!--#include virtual="header.html" -->
15
16     <h1 align="center">Module mod_mime</h1>
17
18     <p>This module associates the request filename's extensions
19     (e.g. .html) with the file's behavior (handlers and filters)
20     and content (mime-type, language, character set and
21     encoding.)</p>
22
23     <p><a href="module-dict.html#Status"
24     rel="Help"><strong>Status:</strong></a> Base<br />
25      <a href="module-dict.html#SourceFile"
26     rel="Help"><strong>Source File:</strong></a> mod_mime.c<br />
27      <a href="module-dict.html#ModuleIdentifier"
28     rel="Help"><strong>Module Identifier:</strong></a>
29     mime_module</p>
30
31     <h2>Summary</h2>
32     This module is used to associate various bits of "meta
33     information" with files by their filename extensions. This
34     information relates the filename of the document to it's
35     mime-type, language, character set and encoding. This
36     information is sent to the browser, and participates in content
37     negotiation, so the user's preferences are respected when
38     choosing one of several possible files to serve. See <a
39     href="mod_negotiation">mod_negotiation</a> for more information
40     about content negotiation. 
41
42     <p>The directives <a href="#addhandler">AddHandler</a>, <a
43     href="#addoutputfilter">AddOutputFilter</a>, and <a
44     href="#addinputfilter">AddInputFilter</a> control the modules
45     or scripts that serve the document.</p>
46
47     <p>In addition, mod_mime may define the "handler" for a
48     document, which controls which module or script will serve the
49     document. With the introduction of "filters" in Apache 2.0,
50     mod_mime can also define the filters that the the content
51     should be processed through (e.g. the Includes output filter
52     for server side scripting) and what filters the client request
53     and POST content should be processed through (the input
54     filters.)</p>
55
56     <p>The directives <a href="#addcharset">AddCharset</a>, <a
57     href="#addencoding">AddEncoding</a>, <a
58     href="#addlanguage">AddLanguage</a> and <a
59     href="#addtype">AddType</a> are all used to map file extensions
60     onto the meta-information for that file. Respectively they set
61     the character set, content-encoding, content-language, and
62     MIME-type (content-type) of documents.</p>
63
64     <p>The directive <a href="#typesconfig">TypesConfig</a> is used
65     to specify a file which also maps extensions onto MIME types.
66     Most administrators use the provided mime.types file which
67     associates common filename extensions with IANA registered
68     content types. The current list is maintained at
69     <code>http://www.isi.edu/in-notes/iana/assignments/media-types/media-types</code>
70     although it may be mirrored elsewhere). This simplifies the
71     httpd.conf file by providing the majority of media-type
72     definitions, and they may be overridden by <a
73     href="#addtype">AddType</a> directives as needed.</p>
74
75     <p><em>Please do not send requests to the Apache httpd Project
76     to add any new entries in the distributed mime.types file
77     unless (1) they are already registered with IANA, and (2) they
78     use widely accepted, non-conflicting filename extensions across
79     platforms. category/x-subtype requests will be automatically
80     rejected, as will any new two-letter extensions as they will
81     likely conflict later with the already crowded language and
82     character set namespace.</em></p>
83
84     <p>The core directives <a
85     href="core.html#forcetype">ForceType</a> and <a
86     href="core.html#sethandler">SetHandler</a> are used to
87     associate all the files in a given container (<em>e.g.</em>,
88     &lt;location&gt;, &lt;directory&gt;, or &lt;Files&gt;) with a
89     particular MIME-type or handler. These settings override any
90     filename extension mappings defined in mod_mime.</p>
91
92     <p>Note that changing the type or encoding of a file does not
93     change the value of the <code>Last-Modified</code> header.
94     Thus, previously cached copies may still be used by a client or
95     proxy, with the previous headers. If you change the
96     meta-information (language, content type, character set or
97     encoding) you may need to 'touch' affected files (updating
98     their last modified date) to ensure that all visitors are
99     receive the corrected content headers.</p>
100
101     <h2>Directives</h2>
102
103     <ul>
104       <li><a href="#addcharset">AddCharset</a></li>
105
106       <li><a href="#addencoding">AddEncoding</a></li>
107
108       <li><a href="#addhandler">AddHandler</a></li>
109
110       <li><a href="#addinputfilter">AddInputFilter</a></li>
111
112       <li><a href="#addlanguage">AddLanguage</a></li>
113
114       <li><a href="#addoutputfilter">AddOutputFilter</a></li>
115
116       <li><a href="#addtype">AddType</a></li>
117
118       <li><a href="#defaultlanguage">DefaultLanguage</a></li>
119
120       <li><a href="#removecharset">RemoveCharset</a></li>
121
122       <li><a href="#removeencoding">RemoveEncoding</a></li>
123
124       <li><a href="#removehandler">RemoveHandler</a></li>
125
126       <li><a href="#removeinputfilter">RemoveInputFilter</a></li>
127
128       <li><a href="#removelanguage">RemoveLanguage</a></li>
129
130       <li><a href="#removeoutputfilter">RemoveOutputFilter</a></li>
131
132       <li><a href="#removetype">RemoveType</a></li>
133
134       <li><a href="#typesconfig">TypesConfig</a></li>
135     </ul>
136
137     <p>See also: <a
138     href="mod_mime_magic.html#mimemagicfile">MimeMagicFile</a>.</p>
139
140     <h2><a id="multipleext" name="multipleext">Files with Multiple
141     Extensions</a></h2>
142     Files can have more than one extension, and the order of the
143     extensions is <em>normally</em> irrelevant. For example, if the
144     file <code>welcome.html.fr</code> maps onto content type
145     text/html and language French then the file
146     <code>welcome.fr.html</code> will map onto exactly the same
147     information. The only exception to this is if an extension is
148     given which Apache does not know how to handle. In this case it
149     will "forget" about any information it obtained from extensions
150     to the left of the unknown extension. So, for example, if the
151     extensions fr and html are mapped to the appropriate language
152     and type but extension xxx is not assigned to anything, then
153     the file <code>welcome.fr.xxx.html</code> will be associated
154     with content-type text/html but <em>no</em> language. 
155
156     <p>If more than one extension is given which maps onto the same
157     type of meta-information, then the one to the right will be
158     used. For example, if ".gif" maps to the MIME-type image/gif
159     and ".html" maps to the MIME-type text/html, then the file
160     <code>welcome.gif.html</code> will be associated with the
161     MIME-type "text/html".</p>
162
163     <p>Care should be taken when a file with multiple extensions
164     gets associated with both a MIME-type and a handler. This will
165     usually result in the request being by the module associated
166     with the handler. For example, if the <code>.imap</code>
167     extension is mapped to the handler "imap-file" (from mod_imap)
168     and the <code>.html</code> extension is mapped to the MIME-type
169     "text/html", then the file <code>world.imap.html</code> will be
170     associated with both the "imap-file" handler and "text/html"
171     MIME-type. When it is processed, the "imap-file" handler will
172     be used, and so it will be treated as a mod_imap imagemap
173     file.</p>
174
175     <h2><a id="contentencoding" name="contentencoding">Content
176     encoding</a></h2>
177     A file of a particular MIME type can additionally be encoded a
178     particular way to simplify transmission over the Internet.
179     While this usually will refer to compression, such as
180     <samp>gzip</samp>, it can also refer to encryption, such a
181     <samp>pgp</samp> or to an encoding such as UUencoding, which is
182     designed for transmitting a binary file in an ASCII (text)
183     format. 
184
185     <p>The MIME RFC puts it this way:</p>
186
187     <blockquote>
188       The Content-Encoding entity-header field is used as a
189       modifier to the media-type. When present, its value indicates
190       what additional content coding has been applied to the
191       resource, and thus what decoding mechanism must be applied in
192       order to obtain the media-type referenced by the Content-Type
193       header field. The Content-Encoding is primarily used to allow
194       a document to be compressed without losing the identity of
195       its underlying media type.
196     </blockquote>
197     By using more than one file extension (see <a
198     href="#multipleext">section above about multiple file
199     extensions</a>), you can indicate that a file is of a
200     particular <em>type</em>, and also has a particular
201     <em>encoding</em>. 
202
203     <p>For example, you may have a file which is a Microsoft Word
204     document, which is pkzipped to reduce its size. If the
205     <samp>.doc</samp> extension is associated with the Microsoft
206     Word file type, and the <samp>.zip</samp> extension is
207     associated with the pkzip file encoding, then the file
208     <samp>Resume.doc.zip</samp>would be known to be a pkzip'ed Word
209     document.</p>
210
211     <p>Apache send a <samp>Content-encoding</samp> header with the
212     resource, in order to tell the client browser about the
213     encoding method.</p>
214
215     <p><samp>Content-encoding: pkzip</samp></p>
216
217     <h2>Character sets and languages</h2>
218     Finally, in addition to file type, and the file encoding,
219     another important piece of information is what language a
220     particular document is in, and in what character set the file
221     should be displayed. For example, the document might be written
222     in the Vietnamese alphabet, or in Cyrillic, and should be
223     displayed as such. This information, also, is transmitted in
224     HTTP headers. 
225
226     <p>While the character set is useful for the browser, in order
227     to determine how to display the document, the language and the
228     character set are also used in the process of content
229     negotiation (See <a
230     href="mod_negotiation.html">mod_negotiation</a>) to determine
231     which document to give to the client, when there are
232     alternative documents in more than one language, or more than
233     one character set.</p>
234
235     <p>To convey this further information, Apache optionally sends
236     a <samp>Content-Language</samp> header, to specify the language
237     that the document is in, and can append additional information
238     onto the <samp>Content-Type</samp> header to indicate the
239     particular character set that should be used to correctly
240     render the information.</p>
241 <pre>
242 Content-Language: en, fr
243 Content-Type: text/plain; charset=ISO-8859-2
244 </pre>
245
246     <p>The language specification is the two-letter abbreviation
247     for the language. The <samp>charset</samp> is the name of the
248     particular character set which should be used.</p>
249     <hr />
250
251     <h2><a id="addcharset" name="addcharset">AddCharset</a>
252     directive</h2>
253     <a href="directive-dict.html#Syntax"
254     rel="Help"><strong>Syntax:</strong></a> AddCharset <em>charset
255     extension</em> [<em>extension</em>] ...<br />
256      <a href="directive-dict.html#Context"
257     rel="Help"><strong>Context:</strong></a> server config, virtual
258     host, directory, .htaccess<br />
259      <a href="directive-dict.html#Override"
260     rel="Help"><strong>Override:</strong></a> FileInfo<br />
261      <a href="directive-dict.html#Status"
262     rel="Help"><strong>Status:</strong></a> Base<br />
263      <a href="directive-dict.html#Module"
264     rel="Help"><strong>Module:</strong></a> mod_mime <br />
265      <a href="directive-dict.html#Compatibility"
266     rel="Help"><strong>Compatibility:</strong></a> AddCharset is
267     only available in Apache 1.3.10 and later 
268
269     <p>The AddCharset directive maps the given filename extensions
270     to the specified content charset. <i>charset</i> is the MIME
271     charset parameter of filenames containing <i>extension</i>.
272     This mapping is added to any already in force, overriding any
273     mappings that already exist for the same <i>extension</i>.</p>
274
275     <p>Example:</p>
276 <pre>
277     AddLanguage ja .ja
278     AddCharset EUC-JP .euc
279     AddCharset ISO-2022-JP .jis
280     AddCharset SHIFT_JIS .sjis
281 </pre>
282
283     <p>Then the document <code>xxxx.ja.jis</code> will be treated
284     as being a Japanese document whose charset is ISO-2022-JP (as
285     will the document <code>xxxx.jis.ja</code>). The AddCharset
286     directive is useful for both to inform the client about the
287     character encoding of the document so that the document can be
288     interpreted and displayed appropriately, and for <a
289     href="../content-negotiation.html">content negotiation</a>,
290     where the server returns one from several documents based on
291     the client's charset preference.</p>
292
293     <p>The <em>extension</em> argument is case-insensitive, and can
294     be specified with or without a leading dot.</p>
295
296     <p><strong>See also</strong>: <a
297     href="mod_negotiation.html">mod_negotiation</a></p>
298     <hr />
299
300     <h2><a id="addencoding" name="addencoding">AddEncoding</a>
301     directive</h2>
302     <a href="directive-dict.html#Syntax"
303     rel="Help"><strong>Syntax:</strong></a> AddEncoding
304     <em>MIME-enc extension</em> [<em>extension</em>] ...<br />
305      <a href="directive-dict.html#Context"
306     rel="Help"><strong>Context:</strong></a> server config, virtual
307     host, directory, .htaccess<br />
308      <a href="directive-dict.html#Override"
309     rel="Help"><strong>Override:</strong></a> FileInfo<br />
310      <a href="directive-dict.html#Status"
311     rel="Help"><strong>Status:</strong></a> Base<br />
312      <a href="directive-dict.html#Module"
313     rel="Help"><strong>Module:</strong></a> mod_mime 
314
315     <p>The AddEncoding directive maps the given filename extensions
316     to the specified encoding type. <em>MIME-enc</em> is the MIME
317     encoding to use for documents containing the
318     <em>extension</em>. This mapping is added to any already in
319     force, overriding any mappings that already exist for the same
320     <em>extension</em>. Example:</p>
321
322     <blockquote>
323       <code>AddEncoding x-gzip .gz<br />
324        AddEncoding x-compress .Z</code>
325     </blockquote>
326     This will cause filenames containing the .gz extension to be
327     marked as encoded using the x-gzip encoding, and filenames
328     containing the .Z extension to be marked as encoded with
329     x-compress. 
330
331     <p>Old clients expect <code>x-gzip</code> and
332     <code>x-compress</code>, however the standard dictates that
333     they're equivalent to <code>gzip</code> and
334     <code>compress</code> respectively. Apache does content
335     encoding comparisons by ignoring any leading <code>x-</code>.
336     When responding with an encoding Apache will use whatever form
337     (<em>i.e.</em>, <code>x-foo</code> or <code>foo</code>) the
338     client requested. If the client didn't specifically request a
339     particular form Apache will use the form given by the
340     <code>AddEncoding</code> directive. To make this long story
341     short, you should always use <code>x-gzip</code> and
342     <code>x-compress</code> for these two specific encodings. More
343     recent encodings, such as <code>deflate</code> should be
344     specified without the <code>x-</code>.</p>
345
346     <p>The <em>extension</em> argument is case-insensitive, and can
347     be specified with or without a leading dot.</p>
348
349     <p><strong>See also</strong>: <a href="#multipleext">Files with
350     multiple extensions</a></p>
351     <hr />
352
353     <h2><a id="addhandler" name="addhandler">AddHandler</a>
354     directive</h2>
355     <a href="directive-dict.html#Syntax"
356     rel="Help"><strong>Syntax:</strong></a> AddHandler
357     <em>handler-name extension</em> [<em>extension</em>] ...<br />
358      <a href="directive-dict.html#Context"
359     rel="Help"><strong>Context:</strong></a> server config, virtual
360     host, directory, .htaccess<br />
361      <a href="directive-dict.html#Override"
362     rel="Help"><strong>Override:</strong></a> FileInfo<br />
363      <a href="directive-dict.html#Status"
364     rel="Help"><strong>Status:</strong></a> Base<br />
365      <a href="directive-dict.html#Module"
366     rel="Help"><strong>Module:</strong></a> mod_mime<br />
367      <a href="directive-dict.html#Compatibility"
368     rel="Help"><strong>Compatibility:</strong></a> AddHandler is
369     only available in Apache 1.1 and later 
370
371     <p>AddHandler maps the filename extensions <em>extension</em>
372     to the <a href="../handler.html">handler</a>
373     <em>handler-name</em>. This mapping is added to any already in
374     force, overriding any mappings that already exist for the same
375     <em>extension</em>. For example, to activate CGI scripts with
376     the file extension "<code>.cgi</code>", you might use:</p>
377 <pre>
378     AddHandler cgi-script .cgi
379 </pre>
380
381     <p>Once that has been put into your srm.conf or httpd.conf
382     file, any file containing the "<code>.cgi</code>" extension
383     will be treated as a CGI program.</p>
384
385     <p>The <em>extension</em> argument is case-insensitive, and can
386     be specified with or without a leading dot.</p>
387
388     <p><strong>See also</strong>: <a href="#multipleext">Files with
389     multiple extensions</a></p>
390     <hr />
391
392     <h2><a id="addinputfilter" name="addinputfilter">AddInputFilter
393     directive</a></h2>
394
395     <p><a href="directive-dict.html#Syntax"
396     rel="Help"><strong>Syntax:</strong></a> AddInputFilter
397     <em>filter</em>[<em>;filter</em>...] extension
398     [<em>extension</em> ...]<br />
399      <a href="directive-dict.html#Default"
400     rel="Help"><strong>Default:</strong></a> none<br />
401      <a href="directive-dict.html#Context"
402     rel="Help"><strong>Context:</strong></a> directory, files,
403     location, .htaccess<br />
404      <a href="directive-dict.html#Status"
405     rel="Help"><strong>Status:</strong></a> mod_mime<br />
406      <a href="directive-dict.html#Compatibility"
407     rel="Help"><strong>Compatibility:</strong></a> AddInputFilter
408     is only available in Apache 2.0.26 and later.</p>
409
410     <p>AddInputFilter maps the filename extensions
411     <em>extension</em> to the filter or filters which will process
412     client requests and POST input when they are received by the
413     server. This is in addition to any filters defined elsewhere,
414     including the <a
415     href="core.html#setinputfilter">SetInputFilter</a> directive.
416     This mapping is merged over any already in force, overriding
417     any mappings that already exist for the same
418     <em>extension</em>.</p>
419
420     <p>If more than one filter is specified, they must be separated
421     by semicolons in the order in which they should process the
422     content. Both the filter and <em>extension</em> arguments are
423     case-insensitive, and the extension may be specified with or
424     without a leading dot.</p>
425
426     <p>See also the <a href="../filter.html">Filters</a>
427     documentation.</p>
428     <hr />
429
430     <h2><a id="addlanguage" name="addlanguage">AddLanguage</a>
431     directive</h2>
432     <a href="directive-dict.html#Syntax"
433     rel="Help"><strong>Syntax:</strong></a> AddLanguage
434     <em>MIME-lang extension</em> [<em>extension</em>] ...<br />
435      <a href="directive-dict.html#Context"
436     rel="Help"><strong>Context:</strong></a> server config, virtual
437     host, directory, .htaccess<br />
438      <a href="directive-dict.html#Override"
439     rel="Help"><strong>Override:</strong></a> FileInfo<br />
440      <a href="directive-dict.html#Status"
441     rel="Help"><strong>Status:</strong></a> Base<br />
442      <a href="directive-dict.html#Module"
443     rel="Help"><strong>Module:</strong></a> mod_mime 
444
445     <p>The AddLanguage directive maps the given filename extension
446     to the specified content language. <em>MIME-lang</em> is the
447     MIME language of filenames containing <em>extension</em>. This
448     mapping is added to any already in force, overriding any
449     mappings that already exist for the same
450     <em>extension</em>.</p>
451
452     <p>Example:</p>
453
454     <blockquote>
455       <code>AddEncoding x-compress .Z<br />
456        AddLanguage en .en<br />
457        AddLanguage fr .fr<br />
458       </code>
459     </blockquote>
460
461     <p>Then the document <code>xxxx.en.Z</code> will be treated as
462     being a compressed English document (as will the document
463     <code>xxxx.Z.en</code>). Although the content language is
464     reported to the client, the browser is unlikely to use this
465     information. The AddLanguage directive is more useful for <a
466     href="../content-negotiation.html">content negotiation</a>,
467     where the server returns one from several documents based on
468     the client's language preference.</p>
469
470     <p>If multiple language assignments are made for the same
471     extension, the last one encountered is the one that is used.
472     That is, for the case of:</p>
473 <pre>
474     AddLanguage en .en
475     AddLanguage en-uk .en
476     AddLanguage en-us .en
477 </pre>
478
479     <p>documents with the extension "<code>.en</code>" would be
480     treated as being "<code>en-us</code>".</p>
481
482     <p>The <em>extension</em> argument is case-insensitive, and can
483     be specified with or without a leading dot.</p>
484
485     <p><strong>See also</strong>: <a href="#multipleext">Files with
486     multiple extensions</a>, <a
487     href="./mod_negotiation.html">mod_negotiation</a></p>
488     <hr />
489
490     <h2><a id="addoutputfilter"
491     name="addoutputfilter">AddOutputFilter directive</a></h2>
492
493     <p><a href="directive-dict.html#Syntax"
494     rel="Help"><strong>Syntax:</strong></a> AddOutputFilter
495     <em>filter</em>[<em>;filter</em>...] extension
496     [<em>extension</em> ...]<br />
497      <a href="directive-dict.html#Default"
498     rel="Help"><strong>Default:</strong></a> none<br />
499      <a href="directive-dict.html#Context"
500     rel="Help"><strong>Context:</strong></a> directory, files,
501     location, .htaccess<br />
502      <a href="directive-dict.html#Status"
503     rel="Help"><strong>Status:</strong></a> mod_mime<br />
504      <a href="directive-dict.html#Compatibility"
505     rel="Help"><strong>Compatibility:</strong></a> AddOutputFilter
506     is only available in Apache 2.0.26 and later.</p>
507
508     <p>The <code>AddOutputFilter</code> directive maps the filename
509     extensions <em>extension</em> to the filters which will process
510     responses from the server before they are sent to the client.
511     This is in addition to any filters defined elsewhere, including
512     the <a href="core.html#setoutputfilter">SetOutputFilter</a>
513     directive. This mapping is merged over any already in force,
514     overriding any mappings that already exist for the same
515     <em>extension</em>.</p>
516     For example, the following configuration will process all
517     .shtml files for server-side includes.<br />
518      <br />
519      
520
521     <blockquote>
522       <code>&nbsp;&nbsp;AddOutputFilter INCLUDES shtml<br />
523       </code>
524     </blockquote>
525
526     <p>If more than one filter is specified, they must be separated
527     by semicolons in the order in which they should process the
528     content. Both the filter and <em>extension</em> arguments are
529     case-insensitive, and the extension may be specified with or
530     without a leading dot.</p>
531
532     <p>See also the <a href="../filter.html">Filters</a>
533     documentation.</p>
534     <hr />
535
536     <h2><a id="addtype" name="addtype">AddType</a> directive</h2>
537     <a href="directive-dict.html#Syntax"
538     rel="Help"><strong>Syntax:</strong></a> AddType <em>MIME-type
539     extension</em> [<em>extension</em>] ...<br />
540      <a href="directive-dict.html#Context"
541     rel="Help"><strong>Context:</strong></a> server config, virtual
542     host, directory, .htaccess<br />
543      <a href="directive-dict.html#Override"
544     rel="Help"><strong>Override:</strong></a> FileInfo<br />
545      <a href="directive-dict.html#Status"
546     rel="Help"><strong>Status:</strong></a> Base<br />
547      <a href="directive-dict.html#Module"
548     rel="Help"><strong>Module:</strong></a> mod_mime 
549
550     <p>The AddType directive maps the given filename extensions
551     onto the specified content type. <em>MIME-type</em> is the MIME
552     type to use for filenames containing <em>extension</em>. This
553     mapping is added to any already in force, overriding any
554     mappings that already exist for the same <em>extension</em>.
555     This directive can be used to add mappings not listed in the
556     MIME types file (see the <code><a
557     href="#typesconfig">TypesConfig</a></code> directive).
558     Example:</p>
559
560     <blockquote>
561       <code>AddType image/gif .gif</code>
562     </blockquote>
563     It is recommended that new MIME types be added using the
564     AddType directive rather than changing the <a
565     href="#typesconfig">TypesConfig</a> file. 
566
567     <p>Note that, unlike the NCSA httpd, this directive cannot be
568     used to set the type of particular files.</p>
569
570     <p>The <em>extension</em> argument is case-insensitive, and can
571     be specified with or without a leading dot.</p>
572
573     <p><strong>See also</strong>: <a href="#multipleext">Files with
574     multiple extensions</a></p>
575     <hr />
576
577     <h2><a id="defaultlanguage"
578     name="defaultlanguage">DefaultLanguage</a> directive</h2>
579     <a href="directive-dict.html#Syntax"
580     rel="Help"><strong>Syntax:</strong></a> DefaultLanguage
581     <em>MIME-lang</em><br />
582      <a href="directive-dict.html#Context"
583     rel="Help"><strong>Context:</strong></a> server config, virtual
584     host, directory, .htaccess<br />
585      <a href="directive-dict.html#Override"
586     rel="Help"><strong>Override:</strong></a> FileInfo<br />
587      <a href="directive-dict.html#Status"
588     rel="Help"><strong>Status:</strong></a> Base<br />
589      <a href="directive-dict.html#Module"
590     rel="Help"><strong>Module:</strong></a> mod_mime<br />
591      <a href="directive-dict.html#Compatibility"
592     rel="Help"><strong>Compatibility:</strong></a> DefaultLanguage
593     is only available in Apache 1.3.4 and later. 
594
595     <p>The DefaultLanguage directive tells Apache that all files in
596     the directive's scope (<em>e.g.</em>, all files covered by the
597     current <code>&lt;Directory&gt;</code> container) that don't
598     have an explicit language extension (such as <samp>.fr</samp>
599     or <samp>.de</samp> as configured by <samp>AddLanguage</samp>)
600     should be considered to be in the specified <em>MIME-lang</em>
601     language. This allows entire directories to be marked as
602     containing Dutch content, for instance, without having to
603     rename each file. Note that unlike using extensions to specify
604     languages, <samp>DefaultLanguage</samp> can only specify a
605     single language.</p>
606
607     <p>If no <samp>DefaultLanguage</samp> directive is in force,
608     and a file does not have any language extensions as configured
609     by <samp>AddLanguage</samp>, then that file will be considered
610     to have no language attribute.</p>
611
612     <p><strong>See also</strong>: <a href="#multipleext">Files with
613     multiple extensions</a>, <a
614     href="./mod_negotiation.html">mod_negotiation</a></p>
615     <hr />
616
617     <h2><a id="removecharset"
618     name="removecharset">RemoveCharset</a> directive</h2>
619     <a href="directive-dict.html#Syntax"
620     rel="Help"><strong>Syntax:</strong></a> RemoveCharset
621     <em>extension</em> [<em>extension</em>] ...<br />
622      <a href="directive-dict.html#Context"
623     rel="Help"><strong>Context:</strong></a> directory,
624     .htaccess<br />
625      <a href="directive-dict.html#Status"
626     rel="Help"><strong>Status:</strong></a> Base<br />
627      <a href="directive-dict.html#Module"
628     rel="Help"><strong>Module:</strong></a> mod_mime<br />
629      <a href="directive-dict.html#Compatibility"
630     rel="Help"><strong>Compatibility:</strong></a> RemoveCharset is
631     only available in Apache 2.0.24 and later. 
632
633     <p>The <samp>RemoveCharset</samp> directive removes any
634     character set associations for files with the given extensions.
635     This allows <code>.htaccess</code> files in subdirectories to
636     undo any associations inherited from parent directories or the
637     server config files.</p>
638
639     <p>The <em>extension</em> argument is case-insensitive, and can
640     be specified with or without a leading dot.</p>
641     <hr />
642
643     <h2><a id="removeencoding"
644     name="removeencoding">RemoveEncoding</a> directive</h2>
645     <a href="directive-dict.html#Syntax"
646     rel="Help"><strong>Syntax:</strong></a> RemoveEncoding
647     <em>extension</em> [<em>extension</em>] ...<br />
648      <a href="directive-dict.html#Context"
649     rel="Help"><strong>Context:</strong></a> directory,
650     .htaccess<br />
651      <a href="directive-dict.html#Status"
652     rel="Help"><strong>Status:</strong></a> Base<br />
653      <a href="directive-dict.html#Module"
654     rel="Help"><strong>Module:</strong></a> mod_mime<br />
655      <a href="directive-dict.html#Compatibility"
656     rel="Help"><strong>Compatibility:</strong></a> RemoveEncoding
657     is only available in Apache 1.3.13 and later. 
658
659     <p>The <samp>RemoveEncoding</samp> directive removes any
660     encoding associations for files with the given extensions. This
661     allows <code>.htaccess</code> files in subdirectories to undo
662     any associations inherited from parent directories or the
663     server config files. An example of its use might be:</p>
664
665     <dl>
666       <dt><code>/foo/.htaccess:</code></dt>
667
668       <dd><code>AddEncoding x-gzip .gz</code><br />
669        <code>AddType text/plain .asc</code><br />
670        <code>&lt;Files *.gz.asc&gt;</code><br />
671        <code>&nbsp;&nbsp;&nbsp;&nbsp;RemoveEncoding
672       .gz</code><br />
673        <code>&lt;/Files&gt;</code></dd>
674     </dl>
675
676     <p>This will cause <code>foo.gz</code> to be marked as being
677     encoded with the gzip method, but <code>foo.gz.asc</code> as an
678     unencoded plaintext file.</p>
679
680     <p><b>Note:</b>RemoveEncoding directives are processed
681     <i>after</i> any AddEncoding directives, so it is possible they
682     may undo the effects of the latter if both occur within the
683     same directory configuration.</p>
684
685     <p>The <em>extension</em> argument is case-insensitive, and can
686     be specified with or without a leading dot.</p>
687     <hr />
688
689     <h2><a id="removehandler"
690     name="removehandler">RemoveHandler</a> directive</h2>
691     <a href="directive-dict.html#Syntax"
692     rel="Help"><strong>Syntax:</strong></a> RemoveHandler
693     <em>extension</em> [<em>extension</em>] ...<br />
694      <a href="directive-dict.html#Context"
695     rel="Help"><strong>Context:</strong></a> directory,
696     .htaccess<br />
697      <a href="directive-dict.html#Status"
698     rel="Help"><strong>Status:</strong></a> Base<br />
699      <a href="directive-dict.html#Module"
700     rel="Help"><strong>Module:</strong></a> mod_mime<br />
701      <a href="directive-dict.html#Compatibility"
702     rel="Help"><strong>Compatibility:</strong></a> RemoveHandler is
703     only available in Apache 1.3.4 and later. 
704
705     <p>The <samp>RemoveHandler</samp> directive removes any handler
706     associations for files with the given extensions. This allows
707     <code>.htaccess</code> files in subdirectories to undo any
708     associations inherited from parent directories or the server
709     config files. An example of its use might be:</p>
710
711     <dl>
712       <dt><code>/foo/.htaccess:</code></dt>
713
714       <dd><code>AddHandler server-parsed .html</code></dd>
715
716       <dt><code>/foo/bar/.htaccess:</code></dt>
717
718       <dd><code>RemoveHandler .html</code></dd>
719     </dl>
720
721     <p>This has the effect of returning <samp>.html</samp> files in
722     the <samp>/foo/bar</samp> directory to being treated as normal
723     files, rather than as candidates for parsing (see the <a
724     href="mod_include.html"><samp>mod_include</samp></a>
725     module).</p>
726
727     <p>The <em>extension</em> argument is case-insensitive, and can
728     be specified with or without a leading dot.</p>
729     <hr />
730
731     <h2><a id="removeinputfilter"
732     name="removeinputfilter">RemoveInputFilter</a> directive</h2>
733     <a href="directive-dict.html#Syntax"
734     rel="Help"><strong>Syntax:</strong></a> RemoveInputFilter
735     <em>extension</em> [<em>extension</em>] ...<br />
736      <a href="directive-dict.html#Context"
737     rel="Help"><strong>Context:</strong></a> directory,
738     .htaccess<br />
739      <a href="directive-dict.html#Status"
740     rel="Help"><strong>Status:</strong></a> Base<br />
741      <a href="directive-dict.html#Module"
742     rel="Help"><strong>Module:</strong></a> mod_mime<br />
743      <a href="directive-dict.html#Compatibility"
744     rel="Help"><strong>Compatibility:</strong></a>
745     RemoveInputFilter is only available in Apache 2.0.26 and later.
746     
747
748     <p>The <samp>RemoveInputFilter</samp> directive removes any
749     input filter associations for files with the given extensions.
750     This allows <code>.htaccess</code> files in subdirectories to
751     undo any associations inherited from parent directories or the
752     server config files.</p>
753
754     <p>The <em>extension</em> argument is case-insensitive, and can
755     be specified with or without a leading dot.</p>
756     <hr />
757
758     <h2><a id="removelanguage"
759     name="removelanguage">RemoveLanguage</a> directive</h2>
760     <a href="directive-dict.html#Syntax"
761     rel="Help"><strong>Syntax:</strong></a> RemoveLanguage
762     <em>extension</em> [<em>extension</em>] ...<br />
763      <a href="directive-dict.html#Context"
764     rel="Help"><strong>Context:</strong></a> directory,
765     .htaccess<br />
766      <a href="directive-dict.html#Status"
767     rel="Help"><strong>Status:</strong></a> Base<br />
768      <a href="directive-dict.html#Module"
769     rel="Help"><strong>Module:</strong></a> mod_mime<br />
770      <a href="directive-dict.html#Compatibility"
771     rel="Help"><strong>Compatibility:</strong></a> RemoveLanguage
772     is only available in Apache 2.0.24 and later. 
773
774     <p>The <samp>RemoveLanguage</samp> directive removes any
775     language associations for files with the given extensions. This
776     allows <code>.htaccess</code> files in subdirectories to undo
777     any associations inherited from parent directories or the
778     server config files.</p>
779
780     <p>The <em>extension</em> argument is case-insensitive, and can
781     be specified with or without a leading dot.</p>
782     <hr />
783
784     <h2><a id="removeoutputfilter"
785     name="removeoutputfilter">RemoveOutputFilter</a> directive</h2>
786     <a href="directive-dict.html#Syntax"
787     rel="Help"><strong>Syntax:</strong></a> RemoveOutputFilter
788     <em>extension</em> [<em>extension</em>] ...<br />
789      <a href="directive-dict.html#Context"
790     rel="Help"><strong>Context:</strong></a> directory,
791     .htaccess<br />
792      <a href="directive-dict.html#Status"
793     rel="Help"><strong>Status:</strong></a> Base<br />
794      <a href="directive-dict.html#Module"
795     rel="Help"><strong>Module:</strong></a> mod_mime<br />
796      <a href="directive-dict.html#Compatibility"
797     rel="Help"><strong>Compatibility:</strong></a>
798     RemoveOutputFilter is only available in Apache 2.0.26 and
799     later. 
800
801     <p>The <samp>RemoveOutputFilter</samp> directive removes any
802     output filter associations for files with the given extensions.
803     This allows <code>.htaccess</code> files in subdirectories to
804     undo any associations inherited from parent directories or the
805     server config files.</p>
806
807     <p>The <em>extension</em> argument is case-insensitive, and can
808     be specified with or without a leading dot.</p>
809     <hr />
810
811     <h2><a id="removetype" name="removetype">RemoveType</a>
812     directive</h2>
813     <a href="directive-dict.html#Syntax"
814     rel="Help"><strong>Syntax:</strong></a> RemoveType
815     <em>extension</em> [<em>extension</em>] ...<br />
816      <a href="directive-dict.html#Context"
817     rel="Help"><strong>Context:</strong></a> directory,
818     .htaccess<br />
819      <a href="directive-dict.html#Status"
820     rel="Help"><strong>Status:</strong></a> Base<br />
821      <a href="directive-dict.html#Module"
822     rel="Help"><strong>Module:</strong></a> mod_mime<br />
823      <a href="directive-dict.html#Compatibility"
824     rel="Help"><strong>Compatibility:</strong></a> RemoveType is
825     only available in Apache 1.3.13 and later. 
826
827     <p>The <samp>RemoveType</samp> directive removes any MIME type
828     associations for files with the given extensions. This allows
829     <code>.htaccess</code> files in subdirectories to undo any
830     associations inherited from parent directories or the server
831     config files. An example of its use might be:</p>
832
833     <dl>
834       <dt><code>/foo/.htaccess:</code></dt>
835
836       <dd><code>RemoveType .cgi</code></dd>
837     </dl>
838
839     <p>This will remove any special handling of <code>.cgi</code>
840     files in the <code>/foo/</code> directory and any beneath it,
841     causing the files to be treated as being of the <a
842     href="core.html#defaulttype">default type</a>.</p>
843
844     <p><b>Note:</b><code>RemoveType</code> directives are processed
845     <i>after</i> any <code>AddType</code> directives, so it is
846     possible they may undo the effects of the latter if both occur
847     within the same directory configuration.</p>
848
849     <p>The <em>extension</em> argument is case-insensitive, and can
850     be specified with or without a leading dot.</p>
851     <hr />
852
853     <h2><a id="typesconfig" name="typesconfig">TypesConfig</a>
854     directive</h2>
855     <a href="directive-dict.html#Syntax"
856     rel="Help"><strong>Syntax:</strong></a> TypesConfig
857     <em>file-path</em><br />
858      <a href="directive-dict.html#Default"
859     rel="Help"><strong>Default:</strong></a> <code>TypesConfig
860     conf/mime.types</code><br />
861      <a href="directive-dict.html#Context"
862     rel="Help"><strong>Context:</strong></a> server config<br />
863      <a href="directive-dict.html#Status"
864     rel="Help"><strong>Status:</strong></a> Base<br />
865      <a href="directive-dict.html#Module"
866     rel="Help"><strong>Module:</strong></a> mod_mime 
867
868     <p>The TypesConfig directive sets the location of the MIME
869     types configuration file. <em>Filename</em> is relative to the
870     <a href="core.html#serverroot">ServerRoot</a>. This file sets
871     the default list of mappings from filename extensions to
872     content types; changing this file is not recommended. Use the
873     <a href="#addtype">AddType</a> directive instead. The file
874     contains lines in the format of the arguments to an AddType
875     command:</p>
876
877     <blockquote>
878       <em>MIME-type extension extension ...</em>
879     </blockquote>
880     The extensions are lower-cased. Blank lines, and lines
881     beginning with a hash character (`#') are ignored. 
882
883     <p><!--#include virtual="footer.html" -->
884     </p>
885   </body>
886 </html>
887