]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_mime.html
Bringing 2.0 docs up to date with the 1.3 docs.
[apache] / docs / manual / mod / mod_mime.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <html>
3 <head>
4 <title>Apache module mod_mime</title>
5 </head>
6
7 <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
8 <body
9  bgcolor="#FFFFFF"
10  text="#000000"
11  LINK="#0000FF"
12  vlink="#000080"
13  alink="#FF0000"
14 >
15 <!--#include virtual="header.html" -->
16 <h1 align="center">Module mod_mime</h1>
17
18 <p>This module provides for determining the types of files
19 from the filename and for association of handlers with files.</p>
20
21 <p><a
22 href="module-dict.html#Status"
23 rel="Help"
24 ><strong>Status:</strong></a> Base
25 <br>
26 <a
27 href="module-dict.html#SourceFile"
28 rel="Help"
29 ><strong>Source File:</strong></a> mod_mime.c
30 <br>
31 <a
32 href="module-dict.html#ModuleIdentifier"
33 rel="Help"
34 ><strong>Module Identifier:</strong></a> mime_module
35 </p>
36
37 <h2>Summary</h2>
38
39 This module is used to determine various bits of "meta information"
40 about documents. This information relates to the content of the
41 document and is returned to the browser or used in content-negotiation
42 within the server. In addition, a "handler" can be set for a document,
43 which determines how the document will be processed within the server.
44
45 <P>
46
47 The directives <a href="#addcharset">AddCharset</a>,
48 <a href="#addencoding">AddEncoding</a>, <a href="#addhandler">AddHandler</a>,
49 <a href="#addlanguage">AddLanguage</a> and <a href="#addtype">AddType</a>
50 are all used to map file extensions onto the meta-information for that
51 file.  Respectively they set the character set, content-encoding, handler,
52 content-language, and MIME-type (content-type) of documents.  The
53 directive <a href="#typesconfig">TypesConfig</a> is used to specify a
54 file which also maps extensions onto MIME types. The directives <a
55 href="#forcetype">ForceType</a> and <a
56 href="#sethandler">SetHandler</a> are used to associated all the files
57 in a given location (<em>e.g.</em>, a particular directory) onto a particular
58 MIME type or handler.
59
60 <P>
61
62 Note that changing the type or encoding of a file does not change the
63 value of the <CODE>Last-Modified</code> header. Thus, previously cached
64 copies may still be used by a client or proxy, with the previous headers.
65
66 <h2>Directives</h2>
67 <ul>
68 <li><a href="#addcharset">AddCharset</a></li>
69 <li><a href="#addencoding">AddEncoding</a>
70 <li><a href="#addhandler">AddHandler</a>
71 <li><a href="#addlanguage">AddLanguage</a>
72 <li><a href="#addtype">AddType</a>
73 <li><a href="#defaultlanguage">DefaultLanguage</a>
74 <li><a href="#forcetype">ForceType</a>
75 <li><a href="#removeencoding">RemoveEncoding</a>
76 <li><a href="#removehandler">RemoveHandler</a>
77 <li><a href="#removetype">RemoveType</a>
78 <li><a href="#sethandler">SetHandler</a>
79 <li><a href="#typesconfig">TypesConfig</a>
80 </ul>
81
82 <p>See also: <a
83 href="mod_mime_magic.html#mimemagicfile">MimeMagicFile</a>.</p>
84
85 <h2><a name="multipleext">Files with Multiple Extensions</a></h2>
86
87 Files can have more than one extension, and the order of the
88 extensions is <em>normally</em> irrelevant. For example, if the file
89 <code>welcome.html.fr</code> maps onto content type text/html and
90 language French then the file <code>welcome.fr.html</code> will map
91 onto exactly the same information. The only exception to this is if an
92 extension is given which Apache does not know how to handle. In this
93 case it will "forget" about any information it obtained from
94 extensions to the left of the unknown extension. So, for example, if
95 the extensions fr and html are mapped to the appropriate language and
96 type but extension xxx is not assigned to anything, then the file
97 <code>welcome.fr.xxx.html</code> will be associated with content-type
98 text/html but <em>no</em> language.
99
100 <P>
101
102 If more than one extension is given which maps onto the same type of
103 meta-information, then the one to the right will be used. For example,
104 if ".gif" maps to the MIME-type image/gif and ".html" maps to the
105 MIME-type text/html, then the file <code>welcome.gif.html</code> will
106 be associated with the MIME-type "text/html".
107
108 <P>
109
110 Care should be taken when a file with multiple extensions gets
111 associated with both a MIME-type and a handler. This will usually
112 result in the request being by the module associated with the
113 handler. For example, if the <code>.imap</code> extension is mapped to
114 the handler "imap-file" (from mod_imap) and the <code>.html</code>
115 extension is mapped to the MIME-type "text/html", then the file
116 <code>world.imap.html</code> will be associated with both the
117 "imap-file" handler and "text/html" MIME-type. When it is processed,
118 the "imap-file" handler will be used, and so it will be treated as a
119 mod_imap imagemap file.
120
121
122 <hr>
123
124 <h2><a name="addcharset">AddCharset</a> directive</h2>
125 <a href="directive-dict.html#Syntax" rel="Help"
126 ><strong>Syntax:</strong></a> AddCharset <em>charset extension</em>
127  [<em>extension</em>] ...<br>
128 <a href="directive-dict.html#Context" rel="Help"
129 ><strong>Context:</strong></a> server config, virtual host, directory, .htaccess<br>
130 <a
131  href="directive-dict.html#Override"
132  rel="Help"
133 ><strong>Override:</strong></a> FileInfo<br>
134 <a
135  href="directive-dict.html#Status"
136  rel="Help"
137 ><strong>Status:</strong></a> Base<br>
138 <a
139  href="directive-dict.html#Module"
140  rel="Help"
141 ><strong>Module:</strong></a> mod_mime
142 <br>
143 <a href="directive-dict.html#Compatibility" rel="Help"
144 ><strong>Compatibility:</strong></a> AddCharset is only available in Apache
145 1.3.10 and later
146
147 <P>
148 The AddCharset directive maps the given filename extensions to the
149 specified content charset. <i>charset</i> is the MIME charset
150 parameter of filenames containing <i>extension</i>.  This mapping is
151 added to any already in force, overriding any mappings that already
152 exist for the same <i>extension</i>.
153 </P>
154 <P>
155 Example:
156 <pre>
157     AddLanguage ja .ja
158     AddCharset EUC-JP .euc
159     AddCharset ISO-2022-JP .jis
160     AddCharset SHIFT_JIS .sjis
161 </pre>
162
163 <P>
164 Then the document <code>xxxx.ja.jis</code> will be treated as being a
165 Japanese document whose charset is ISO-2022-JP (as will the document
166 <code>xxxx.jis.ja</code>). The AddCharset directive is useful for both
167 to inform the client about the character encoding of the document so
168 that the document can be interpreted and displayed appropriately, and
169 for <a href="../content-negotiation.html">content negotiation</a>, where
170 the server returns one from several documents based on the client's
171 charset preference.
172 </P>
173
174 <p>The <em>extension</em> argument is case-insensitive, and can
175 be specified with or without a leading dot.</p>
176
177 <P>
178 <strong>See also</strong>: <a href="mod_negotiation.html">mod_negotiation</a>
179 </P>
180
181 <hr>
182
183 <h2><a name="addencoding">AddEncoding</a> directive</h2>
184 <a
185  href="directive-dict.html#Syntax"
186  rel="Help"
187 ><strong>Syntax:</strong></a> AddEncoding <em>MIME-enc extension</em>
188     [<em>extension</em>] ...<br>
189 <a
190  href="directive-dict.html#Context"
191  rel="Help"
192 ><strong>Context:</strong></a> server config, virtual host, directory, .htaccess<br>
193 <a
194  href="directive-dict.html#Override"
195  rel="Help"
196 ><strong>Override:</strong></a> FileInfo<br>
197 <a
198  href="directive-dict.html#Status"
199  rel="Help"
200 ><strong>Status:</strong></a> Base<br>
201 <a
202  href="directive-dict.html#Module"
203  rel="Help"
204 ><strong>Module:</strong></a> mod_mime<P>
205
206 The AddEncoding directive maps the given filename extensions to the
207 specified encoding type. <em>MIME-enc</em> is the MIME encoding to use
208 for documents containing the <em>extension</em>. This mapping is added
209 to any already in force, overriding any mappings that already exist
210 for the same <em>extension</em>.
211
212 Example:
213 <blockquote><code>
214 AddEncoding x-gzip .gz<br> 
215 AddEncoding x-compress .Z
216 </code></blockquote>
217
218 This will cause filenames containing the .gz extension to be marked as
219 encoded using the x-gzip encoding, and filenames containing the .Z
220 extension to be marked as encoded with x-compress.<P>
221
222 Old clients expect <code>x-gzip</code> and <code>x-compress</code>,
223 however the standard dictates that they're equivalent to <code>gzip</code>
224 and <code>compress</code> respectively.  Apache does content encoding
225 comparisons by ignoring any leading <code>x-</code>.  When responding
226 with an encoding Apache will use whatever form (<em>i.e.</em>, <code>x-foo</code>
227 or <code>foo</code>) the client requested.  If the client didn't
228 specifically request a particular form Apache will use the form given by
229 the <code>AddEncoding</code> directive.  To make this long story short,
230 you should always use <code>x-gzip</code> and <code>x-compress</code>
231 for these two specific encodings.  More recent encodings, such as
232 <code>deflate</code> should be specified without the <code>x-</code>.
233
234 <p>The <em>extension</em> argument is case-insensitive, and can
235 be specified with or without a leading dot.</p>
236
237 <P>
238
239 <strong>See also</strong>: <a href="#multipleext">Files with
240 multiple extensions</a>
241
242 <P><hr>
243
244 <h2><a name="addhandler">AddHandler</a> directive</h2>
245
246 <a
247  href="directive-dict.html#Syntax"
248  rel="Help"
249 ><strong>Syntax:</strong></a> AddHandler <em>handler-name extension</em>
250      [<em>extension</em>] ...<br>
251 <a
252  href="directive-dict.html#Context"
253  rel="Help"
254 ><strong>Context:</strong></a> server config, virtual host, directory, .htaccess<br>
255 <a
256  href="directive-dict.html#Override"
257  rel="Help"
258 ><strong>Override:</strong></a> FileInfo<br>
259 <a
260  href="directive-dict.html#Status"
261  rel="Help"
262 ><strong>Status:</strong></a> Base<br>
263 <a
264  href="directive-dict.html#Module"
265  rel="Help"
266 ><strong>Module:</strong></a> mod_mime<br>
267 <a
268  href="directive-dict.html#Compatibility"
269  rel="Help"
270 ><strong>Compatibility:</strong></a> AddHandler is only available in Apache
271 1.1 and later<P>
272
273 <P>AddHandler maps the filename extensions <em>extension</em> to the
274 <a href="../handler.html">handler</a> <em>handler-name</em>.  This
275 mapping is added to any already in force, overriding any mappings that
276 already exist for the same <em>extension</em>.
277
278 For example, to activate CGI scripts
279 with the file extension "<code>.cgi</code>", you might use:
280 <pre>
281     AddHandler cgi-script .cgi
282 </pre>
283
284 <P>Once that has been put into your srm.conf or httpd.conf file, any
285 file containing the "<code>.cgi</code>" extension will be treated as a
286 CGI program.</P> 
287
288 <p>The <em>extension</em> argument is case-insensitive, and can
289 be specified with or without a leading dot.</p>
290
291 <P>
292
293 <strong>See also</strong>: <a href="#multipleext">Files with
294 multiple extensions</a>
295
296 <hr>
297
298 <h2><a name="addlanguage">AddLanguage</a> directive</h2>
299 <a
300  href="directive-dict.html#Syntax"
301  rel="Help"
302 ><strong>Syntax:</strong></a> AddLanguage <em>MIME-lang extension</em>
303     [<em>extension</em>] ...<br>
304 <a
305  href="directive-dict.html#Context"
306  rel="Help"
307 ><strong>Context:</strong></a> server config, virtual host, directory, .htaccess<br>
308 <a
309  href="directive-dict.html#Override"
310  rel="Help"
311 ><strong>Override:</strong></a> FileInfo<br>
312 <a
313  href="directive-dict.html#Status"
314  rel="Help"
315 ><strong>Status:</strong></a> Base<br>
316 <a
317  href="directive-dict.html#Module"
318  rel="Help"
319 ><strong>Module:</strong></a> mod_mime
320
321 <P>
322 The AddLanguage directive maps the given filename extension to the
323 specified content language. <em>MIME-lang</em> is the MIME language of
324 filenames containing <em>extension</em>.  This mapping is added to any
325 already in force, overriding any mappings that already exist for the
326 same <em>extension</em>.
327 </P>
328 <P>
329 Example:
330 </p>
331 <blockquote><code>
332 AddEncoding x-compress .Z<br> AddLanguage en .en<br> AddLanguage fr
333 .fr<br> </code></blockquote>
334
335 <P>
336 Then the document <code>xxxx.en.Z</code> will be treated as being a
337 compressed English document (as will the document
338 <code>xxxx.Z.en</code>). Although the content language is reported to
339 the client, the browser is unlikely to use this information. The
340 AddLanguage directive is more useful for
341 <a href="../content-negotiation.html">content negotiation</a>, where
342 the server returns one from several documents based on the client's
343 language preference.
344 </P>
345 <P>
346 If multiple language assignments are made for the same extension,
347 the last one encountered is the one that is used.  That is, for the
348 case of:
349 </P>
350 <pre>
351     AddLanguage en .en
352     AddLanguage en-uk .en
353     AddLanguage en-us .en
354 </pre>
355 <P>
356 documents with the extension "<code>.en</code>" would be treated as
357 being "<code>en-us</code>".
358 </P>
359
360 <p>The <em>extension</em> argument is case-insensitive, and can
361 be specified with or without a leading dot.</p>
362
363 <P>
364 <strong>See also</strong>: <a href="#multipleext">Files with
365 multiple extensions</a>
366 <br>
367 <strong>See also</strong>: <a
368 href="./mod_negotiation.html">mod_negotiation</a>
369 </P>
370
371 <hr>
372
373 <h2><a name="addtype">AddType</a> directive</h2>
374 <a
375  href="directive-dict.html#Syntax"
376  rel="Help"
377 ><strong>Syntax:</strong></a> AddType <em>MIME-type extension</em>
378    [<em>extension</em>] ...<br>
379 <a
380  href="directive-dict.html#Context"
381  rel="Help"
382 ><strong>Context:</strong></a> server config, virtual host, directory, .htaccess<br>
383 <a
384  href="directive-dict.html#Override"
385  rel="Help"
386 ><strong>Override:</strong></a> FileInfo<br>
387 <a
388  href="directive-dict.html#Status"
389  rel="Help"
390 ><strong>Status:</strong></a> Base<br>
391 <a
392  href="directive-dict.html#Module"
393  rel="Help"
394 ><strong>Module:</strong></a> mod_mime<P>
395
396 The AddType directive maps the given filename extensions onto the
397 specified content type. <em>MIME-type</em> is the MIME type to use for
398 filenames containing <em>extension</em>.  This mapping is added to any
399 already in force, overriding any mappings that already exist for the
400 same <em>extension</em>. This directive can be used to add mappings
401 not listed in the MIME types file (see the <code><a
402 href="#typesconfig">TypesConfig</a></code> directive).
403
404 Example:
405 <blockquote><code>
406 AddType image/gif .gif
407 </code></blockquote>
408 It is recommended that new MIME types be added using the AddType directive
409 rather than changing the <a href="#typesconfig">TypesConfig</a> file.<P>
410 Note that, unlike the NCSA httpd, this directive cannot be used to set the
411 type of particular files.<P>
412
413 <p>The <em>extension</em> argument is case-insensitive, and can
414 be specified with or without a leading dot.</p>
415
416 <P>
417
418 <strong>See also</strong>: <a href="#multipleext">Files with
419 multiple extensions</a>
420
421 <hr>
422
423 <h2><a name="defaultlanguage">DefaultLanguage</a> directive</h2>
424 <a
425  href="directive-dict.html#Syntax"
426  rel="Help"
427 ><strong>Syntax:</strong></a> DefaultLanguage <em>MIME-lang</em><br>
428 <a
429  href="directive-dict.html#Context"
430  rel="Help"
431 ><strong>Context:</strong></a> server config, virtual host, directory, .htaccess<br>
432 <a
433  href="directive-dict.html#Override"
434  rel="Help"
435 ><strong>Override:</strong></a> FileInfo<br>
436 <a
437  href="directive-dict.html#Status"
438  rel="Help"
439 ><strong>Status:</strong></a> Base<br>
440 <a
441  href="directive-dict.html#Module"
442  rel="Help"
443 ><strong>Module:</strong></a> mod_mime<br>
444 <a
445  href="directive-dict.html#Compatibility"
446  rel="Help"
447 ><strong>Compatibility:</strong></a> DefaultLanguage is only available in Apache
448 1.3.4 and later.<P>
449
450 The DefaultLanguage directive tells Apache that all files in the
451 directive's scope (<em>e.g.</em>, all files covered by the current
452 <code>&lt;Directory&gt;</code> container) that don't have an explicit
453 language extension (such as <samp>.fr</samp> or <samp>.de</samp> as
454 configured by <samp>AddLanguage</samp>) should be considered to be in
455 the specified <em>MIME-lang</em> language.  This allows entire
456 directories to be marked as containing Dutch content, for instance,
457 without having to rename each file. Note that unlike using extensions
458 to specify languages, <samp>DefaultLanguage</samp> can only specify a
459 single language.
460
461 <P>
462
463 If no <samp>DefaultLanguage</samp> directive is in force, and a file
464 does not have any language extensions as configured by
465 <samp>AddLanguage</samp>, then that file will be considered to have no
466 language attribute.
467
468 <P>
469
470 <strong>See also</strong>: <a
471 href="./mod_negotiation.html">mod_negotiation</a>
472 <br>
473 <strong>See also</strong>: <a href="#multipleext">Files with
474 multiple extensions</a>
475
476 <hr>
477
478 <h2><a name="forcetype">ForceType</a> directive</h2>
479
480 <a
481  href="directive-dict.html#Syntax"
482  rel="Help"
483 ><strong>Syntax:</strong></a> ForceType <em>media-type</em><br>
484 <a
485  href="directive-dict.html#Context"
486  rel="Help"
487 ><strong>Context:</strong></a> directory, .htaccess<br>
488 <a
489  href="directive-dict.html#Status"
490  rel="Help"
491 ><strong>Status:</strong></a> Base<br>
492 <a
493  href="directive-dict.html#Module"
494  rel="Help"
495 ><strong>Module:</strong></a> mod_mime<br>
496 <a
497  href="directive-dict.html#Compatibility"
498  rel="Help"
499 ><strong>Compatibility:</strong></a> ForceType is only available in Apache
500 1.1 and later.<P>
501
502 <P>When placed into an <code>.htaccess</code> file or a
503 <code>&lt;Directory&gt;</code> or <code>&lt;Location&gt;</code> section,
504 this directive forces all matching files to be served
505 as the content type given by <em>media type</em>. For example, if you
506 had a directory full of GIF files, but did not want to label them all with
507 ".gif", you might want to use:
508 <pre>
509     ForceType image/gif
510 </pre>
511 <P>Note that this will override any filename extensions that might determine
512 the media type.</P><hr>
513
514 <h2><a name="removeencoding">RemoveEncoding</a> directive</h2>
515
516 <a
517  href="directive-dict.html#Syntax"
518  rel="Help"
519 ><strong>Syntax:</strong></a> RemoveEncoding <em>extension</em>
520      [<em>extension</em>] ...<br>
521 <a
522  href="directive-dict.html#Context"
523  rel="Help"
524 ><strong>Context:</strong></a> directory, .htaccess<br>
525 <a
526  href="directive-dict.html#Status"
527  rel="Help"
528 ><strong>Status:</strong></a> Base<br>
529 <a
530  href="directive-dict.html#Module"
531  rel="Help"
532 ><strong>Module:</strong></a> mod_mime<br>
533 <a
534  href="directive-dict.html#Compatibility"
535  rel="Help"
536 ><strong>Compatibility:</strong></a> RemoveEncoding is only available in Apache
537 1.3.13 and later.<P>
538
539 <P>
540 The <samp>RemoveEncoding</samp> directive removes any
541 encoding associations for files with the given extensions.
542 This allows <code>.htaccess</code> files in subdirectories to undo
543 any associations inherited from parent directories or the server
544 config files.  An example of its use might be:
545 </P>
546 <DL>
547  <DT><code>/foo/.htaccess:</code></DT>
548  <DD><code>AddEncoding x-gzip .gz</code>
549      <br>
550      <code>AddType text/plain .asc</code>
551      <br>
552      <code>&lt;Files *.gz.asc&gt;</code>
553      <br>
554      <code>&nbsp;&nbsp;&nbsp;&nbsp;RemoveEncoding .gz</code>
555      <br>
556      <code>&lt;/Files&gt;</code></dd>
557 </DL>
558 <P>
559 This will cause <code>foo.gz</code> to mark as being encoded with the
560 gzip method, but <code>foo.gz.asc</code> as an unencoded plaintext file.
561 </P>
562 <p>
563 <b>Note:</b>RemoveEncoding directives are processed <i>after</i> any
564 AddEncoding directives, so it is possible they may undo the effects
565 of the latter if both occur within the same directory configuration.
566 </p>
567 <p>The <em>extension</em> argument is case-insensitive, and can
568 be specified with or without a leading dot.</p>
569
570 <hr>
571
572 <h2><a name="removehandler">RemoveHandler</a> directive</h2>
573
574 <a
575  href="directive-dict.html#Syntax"
576  rel="Help"
577 ><strong>Syntax:</strong></a> RemoveHandler <em>extension</em>
578      [<em>extension</em>] ...<br>
579 <a
580  href="directive-dict.html#Context"
581  rel="Help"
582 ><strong>Context:</strong></a> directory, .htaccess<br>
583 <a
584  href="directive-dict.html#Status"
585  rel="Help"
586 ><strong>Status:</strong></a> Base<br>
587 <a
588  href="directive-dict.html#Module"
589  rel="Help"
590 ><strong>Module:</strong></a> mod_mime<br>
591 <a
592  href="directive-dict.html#Compatibility"
593  rel="Help"
594 ><strong>Compatibility:</strong></a> RemoveHandler is only available in Apache
595 1.3.4 and later.<P>
596
597 <P>
598 The <samp>RemoveHandler</samp> directive removes any
599 handler associations for files with the given extensions.
600 This allows <code>.htaccess</code> files in subdirectories to undo
601 any associations inherited from parent directories or the server
602 config files.  An example of its use might be:
603 </P>
604 <dl>
605  <dt><code>/foo/.htaccess:</code></dt>
606  <dd><code>AddHandler server-parsed .html</code></dd>
607  <dt><code>/foo/bar/.htaccess:</code></dt>
608  <dd><code>RemoveHandler .html</code></dd>
609 </dl>
610 <P>
611 This has the effect of returning <samp>.html</samp> files in the
612 <samp>/foo/bar</samp> directory to being treated as normal
613 files, rather than as candidates for parsing (see the
614 <a href="mod_include.html"><samp>mod_include</samp></a> module).
615 </P>
616 <p>The <em>extension</em> argument is case-insensitive, and can
617 be specified with or without a leading dot.</p>
618
619 <hr>
620
621 <h2><a name="removetype">RemoveType</a> directive</h2>
622
623 <a
624  href="directive-dict.html#Syntax"
625  rel="Help"
626 ><strong>Syntax:</strong></a> RemoveType <em>extension</em>
627      [<em>extension</em>] ...<br>
628 <a
629  href="directive-dict.html#Context"
630  rel="Help"
631 ><strong>Context:</strong></a> directory, .htaccess<br>
632 <a
633  href="directive-dict.html#Status"
634  rel="Help"
635 ><strong>Status:</strong></a> Base<br>
636 <a
637  href="directive-dict.html#Module"
638  rel="Help"
639 ><strong>Module:</strong></a> mod_mime<br>
640 <a
641  href="directive-dict.html#Compatibility"
642  rel="Help"
643 ><strong>Compatibility:</strong></a> RemoveType is only available in Apache
644 1.3.13 and later.<P>
645
646 <P>
647 The <samp>RemoveType</samp> directive removes any
648 MIME type associations for files with the given extensions.
649 This allows <code>.htaccess</code> files in subdirectories to undo
650 any associations inherited from parent directories or the server
651 config files.  An example of its use might be:
652 </P>
653 <dl>
654  <dt><code>/foo/.htaccess:</code></dt>
655  <dd><code>RemoveType .cgi</code></dd>
656 </dl>
657 <P>
658 This will remove any special handling of <code>.cgi</code> files in the
659 <code>/foo/</code> directory and any beneath it, causing the files to be
660 treated as being of the <a href="core.html#defaulttype">default type</a>.
661 </P>
662 <p>
663 <b>Note:</b><code>RemoveType</code> directives are processed <i>after</i> any
664 <code>AddType</code> directives, so it is possible they may undo the effects
665 of the latter if both occur within the same directory configuration.
666 </p>
667 <p>The <em>extension</em> argument is case-insensitive, and can
668 be specified with or without a leading dot.</p>
669
670 <hr>
671
672 <h2><a name="sethandler">SetHandler</a> directive</h2>
673
674 <a
675  href="directive-dict.html#Syntax"
676  rel="Help"
677 ><strong>Syntax:</strong></a> SetHandler <em>handler-name</em><br>
678 <a
679  href="directive-dict.html#Context"
680  rel="Help"
681 ><strong>Context:</strong></a> directory, .htaccess<br>
682 <a
683  href="directive-dict.html#Status"
684  rel="Help"
685 ><strong>Status:</strong></a> Base<br>
686 <a
687  href="directive-dict.html#Module"
688  rel="Help"
689 ><strong>Module:</strong></a> mod_mime<br>
690 <a
691  href="directive-dict.html#Compatibility"
692  rel="Help"
693 ><strong>Compatibility:</strong></a> SetHandler is only available in Apache
694 1.1 and later.<P>
695
696 <P>When placed into an <code>.htaccess</code> file or a
697 <code>&lt;Directory&gt;</code> or <code>&lt;Location&gt;</code> section,
698 this directive forces all matching files to be parsed through the
699 <a href="../handler.html">handler</a>
700 given by <em>handler-name</em>. For example, if you had a
701 directory you wanted to be parsed entirely as imagemap rule files,
702 regardless of extension, you might put the following into an
703 <code>.htaccess</code> file in that directory:
704 <pre>
705     SetHandler imap-file
706 </pre>
707
708 <P>Another example: if you wanted to have the server display a status
709 report whenever a URL of <code>http://servername/status</code> was
710 called, you might put the following into access.conf:
711 <pre>
712     &lt;Location /status&gt;
713     SetHandler server-status
714     &lt;/Location&gt;
715 </pre>
716 <hr>
717
718 <h2><a name="typesconfig">TypesConfig</a> directive</h2>
719 <a
720  href="directive-dict.html#Syntax"
721  rel="Help"
722 ><strong>Syntax:</strong></a> TypesConfig <em>file-path</em><br>
723 <a
724  href="directive-dict.html#Default"
725  rel="Help"
726 ><strong>Default:</strong></a> <code>TypesConfig conf/mime.types</code><br>
727 <a
728  href="directive-dict.html#Context"
729  rel="Help"
730 ><strong>Context:</strong></a> server config<br>
731 <a
732  href="directive-dict.html#Status"
733  rel="Help"
734 ><strong>Status:</strong></a> Base<br>
735 <a
736  href="directive-dict.html#Module"
737  rel="Help"
738 ><strong>Module:</strong></a> mod_mime<P>
739
740 The TypesConfig directive sets the location of the MIME types configuration
741 file. <em>Filename</em> is relative to the
742 <a href="core.html#serverroot">ServerRoot</a>. This file sets the default list of
743 mappings from filename extensions to content types; changing this file is not
744 recommended. Use the <a href="#addtype">AddType</a> directive instead. The
745 file contains lines in the format of the arguments to an AddType command:
746 <blockquote><em>MIME-type extension extension ...</em></blockquote>
747 The extensions are lower-cased. Blank lines, and lines beginning with a hash
748 character (`#') are ignored.<P>
749
750 <!--#include virtual="footer.html" -->
751 </body>
752 </html>
753