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