summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_mime.html.en
blob: 60b84063a3b746ce98bdca484aadd92f13093192 (plain)
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
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<!--
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
              This file is generated from xml source: DO NOT EDIT
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      -->
<title>mod_mime - Apache HTTP Server Version 2.4</title>
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
<script src="../style/scripts/prettify.min.js" type="text/javascript">
</script>

<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body>
<div id="page-header">
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
<p class="apache">Apache HTTP Server Version 2.4</p>
<img alt="" src="../images/feather.png" /></div>
<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path">
<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.4</a> &gt; <a href="./">Modules</a></div>
<div id="page-content">
<div id="preamble"><h1>Apache Module mod_mime</h1>
<div class="toplang">
<p><span>Available Languages: </span><a href="../en/mod/mod_mime.html" title="English">&nbsp;en&nbsp;</a> |
<a href="../fr/mod/mod_mime.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
<a href="../ja/mod/mod_mime.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
</div>
<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Associates the requested filename's extensions
    with the file's behavior (handlers and filters)
    and content (mime-type, language, character set and
    encoding)</td></tr>
<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>mime_module</td></tr>
<tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_mime.c</td></tr></table>
<h3>Summary</h3>

    <p>This module is used to assign content metadata to the content
    selected for an HTTP response by mapping patterns in the
    URI or filenames to the metadata values.  For example, the filename
    extensions of content files often define the content's Internet
    media type, language, character set, and content-encoding. This
    information is sent in HTTP messages containing that content and
    used in content negotiation when selecting alternatives, such that
    the user's preferences are respected when choosing one of several
    possible contents to serve. See
    <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code> for more information
    about <a href="../content-negotiation.html">content negotiation</a>.</p>

    <p>The directives <code class="directive"><a href="#addcharset">AddCharset</a></code>, <code class="directive"><a href="#addencoding">AddEncoding</a></code>, <code class="directive"><a href="#addlanguage">AddLanguage</a></code> and <code class="directive"><a href="#addtype">AddType</a></code> are all used to map file
    extensions onto the metadata for that file. Respectively
    they set the character set, content-encoding, content-language,
    and <a class="glossarylink" href="../glossary.html#media-type" title="see glossary">media-type</a> (content-type) of documents.  The directive <code class="directive"><a href="#typesconfig">TypesConfig</a></code> is used to specify a
    file which also maps extensions onto media types. </p>

    <p>In addition, <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> may define the <a href="../handler.html">handler</a> and <a href="../filter.html">filters</a> that originate and process
    content.  The directives <code class="directive"><a href="#addhandler">AddHandler</a></code>, <code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code>, and <code class="directive"><a href="#addinputfilter">AddInputFilter</a></code> control the modules
    or scripts that serve the document.  The <code class="directive"><a href="#multiviewsmatch">MultiviewsMatch</a></code> directive allows
    <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code> to consider these file extensions
    to be included when testing Multiviews matches.</p>

    <p>While <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> associates metadata
    with filename extensions, the <code class="module"><a href="../mod/core.html">core</a></code> server
    provides directives that are used to associate all the files in a
    given container (<em>e.g.</em>, <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code>, <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code>, or <code class="directive"><a href="../mod/core.html#files">&lt;Files&gt;</a></code>) with particular
    metadata. These directives include <code class="directive"><a href="../mod/core.html#forcetype">ForceType</a></code>, <code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code>, <code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code>, and <code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code>.  The core directives
    override any filename extension mappings defined in
    <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code>.</p>

    <p>Note that changing the metadata for 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. If you change the
    metadata (language, content type, character set or
    encoding) you may need to 'touch' affected files (updating
    their last modified date) to ensure that all visitors are
    receive the corrected content headers.</p>
</div>
<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>Topics</h3>
<ul id="topics">
<li><img alt="" src="../images/down.gif" /> <a href="#multipleext">Files with Multiple Extensions</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#contentencoding">Content encoding</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#charset-lang">Character sets and languages</a></li>
</ul><h3 class="directives">Directives</h3>
<ul id="toc">
<li><img alt="" src="../images/down.gif" /> <a href="#addcharset">AddCharset</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#addencoding">AddEncoding</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#addhandler">AddHandler</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#addinputfilter">AddInputFilter</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#addlanguage">AddLanguage</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#addoutputfilter">AddOutputFilter</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#addtype">AddType</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#defaultlanguage">DefaultLanguage</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#modmimeusepathinfo">ModMimeUsePathInfo</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#multiviewsmatch">MultiviewsMatch</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#removecharset">RemoveCharset</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#removeencoding">RemoveEncoding</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#removehandler">RemoveHandler</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#removeinputfilter">RemoveInputFilter</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#removelanguage">RemoveLanguage</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#removeoutputfilter">RemoveOutputFilter</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#removetype">RemoveType</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#typesconfig">TypesConfig</a></li>
</ul>
<h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_mime">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_mime">Report a bug</a></li></ul><h3>See also</h3>
<ul class="seealso">
<li><code class="directive"><a href="../mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code></li>
<li><code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code></li>
<li><code class="directive"><a href="../mod/core.html#forcetype">ForceType</a></code></li>
<li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li>
<li><code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code></li>
<li><code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code></li>
<li><a href="#comments_section">Comments</a></li></ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="multipleext" id="multipleext">Files with Multiple Extensions</a></h2>
    <p>Files can have more than one extension; the order of the
    extensions is <em>normally</em> irrelevant. For example, if the
    file <code>welcome.html.fr</code> maps onto content type
    <code>text/html</code> and language French then the file
    <code>welcome.fr.html</code> will map onto exactly the same
    information.  If more than one extension is given that maps onto
    the same type of metadata, then the one to the right will
    be used, except for languages and content encodings. For example,
    if <code>.gif</code> maps to the <a class="glossarylink" href="../glossary.html#media-type" title="see glossary">media-type</a>
    <code>image/gif</code> and <code>.html</code> maps to the
    media-type <code>text/html</code>, then the file
    <code>welcome.gif.html</code> will be associated with the
    media-type <code>text/html</code>.</p>

    <p><a href="#charset-lang">Languages</a> and <a href="#contentencoding">content encodings</a> are treated accumulative, because one can assign
    more than one language or encoding to a particular resource. For example,
    the file <code>welcome.html.en.de</code> will be delivered with
    <code>Content-Language: en, de</code> and <code>Content-Type:
    text/html</code>.</p>

    <p>Care should be taken when a file with multiple extensions
    gets associated with both a <a class="glossarylink" href="../glossary.html#media-type" title="see glossary">media-type</a>
    and a handler. This will
    usually result in the request being handled by the module associated
    with the handler. For example, if the <code>.imap</code>
    extension is mapped to the handler <code>imap-file</code> (from
    <code class="module"><a href="../mod/mod_imagemap.html">mod_imagemap</a></code>) and the <code>.html</code> extension is
    mapped to the media-type <code>text/html</code>, then the file
    <code>world.imap.html</code> will be associated with both the
    <code>imap-file</code> handler and <code>text/html</code> media-type.
    When it is processed, the <code>imap-file</code> handler will be used,
    and so it will be treated as a <code class="module"><a href="../mod/mod_imagemap.html">mod_imagemap</a></code> imagemap
    file.</p>

    <p>If you would prefer only the last dot-separated part of the
    filename to be mapped to a particular piece of meta-data, then do
    not use the <code>Add*</code> directives. For example, if you wish
    to have the file <code>foo.html.cgi</code> processed as a CGI
    script, but not the file <code>bar.cgi.html</code>, then instead
    of using <code>AddHandler cgi-script .cgi</code>, use</p>

    <div class="example"><h3>Configure handler based on final extension only</h3><pre class="prettyprint lang-config">&lt;FilesMatch "[^.]+\.cgi$"&gt;
  SetHandler cgi-script
&lt;/FilesMatch&gt;</pre>
</div>

</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="contentencoding" id="contentencoding">Content encoding</a></h2>
    <p>A file of a particular <a class="glossarylink" href="../glossary.html#media-type" title="see glossary">media-type</a> can additionally be encoded a
    particular way to simplify transmission over the Internet.
    While this usually will refer to compression, such as
    <code>gzip</code>, it can also refer to encryption, such a
    <code>pgp</code> or to an encoding such as UUencoding, which is
    designed for transmitting a binary file in an ASCII (text)
    format.</p>

    <p>The <a href="http://www.ietf.org/rfc/rfc2616.txt">HTTP/1.1
    RFC</a>, section 14.11 puts it this way:</p>

    <blockquote cite="http://www.ietf.org/rfc/rfc2616.txt">
      <p>The Content-Encoding entity-header field is used as a modifier to
      the media-type. When present, its value indicates what additional
      content codings have been applied to the entity-body, and thus what
      decoding mechanisms must be applied in order to obtain the media-type
      referenced by the Content-Type header field. Content-Encoding is
      primarily used to allow a document to be compressed without losing
      the identity of its underlying media type.</p>
    </blockquote>

    <p>By using more than one file extension (see <a href="#multipleext">section above about multiple file
    extensions</a>), you can indicate that a file is of a
    particular <em>type</em>, and also has a particular
    <em>encoding</em>. </p>

    <p>For example, you may have a file which is a Microsoft Word
    document, which is pkzipped to reduce its size. If the
    <code>.doc</code> extension is associated with the Microsoft
    Word file type, and the <code>.zip</code> extension is
    associated with the pkzip file encoding, then the file
    <code>Resume.doc.zip</code> would be known to be a pkzip'ed Word
    document.</p>

    <p>Apache sends a <code>Content-encoding</code> header with the
    resource, in order to tell the client browser about the
    encoding method.</p>

    <pre class="prettyprint lang-config">Content-encoding: pkzip</pre>

</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="charset-lang" id="charset-lang">Character sets and languages</a></h2>
    <p>In addition to file type and the file encoding,
    another important piece of information is what language a
    particular document is in, and in what character set the file
    should be displayed. For example, the document might be written
    in the Vietnamese alphabet, or in Cyrillic, and should be
    displayed as such. This information, also, is transmitted in
    HTTP headers.</p>

    <p>The character set, language, encoding and mime type are all
    used in the process of content negotiation (See
    <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>) to determine
    which document to give to the client, when there are
    alternative documents in more than one character set, language,
    encoding or mime type. All filename extensions associations
    created with <code class="directive"><a href="#addcharset">AddCharset</a></code>,
    <code class="directive"><a href="#addencoding">AddEncoding</a></code>, <code class="directive"><a href="#addlanguage">AddLanguage</a></code> and <code class="directive"><a href="#addtype">AddType</a></code> directives
    (and extensions listed in the <code class="directive"><a href="../mod/mod_mime_magic.html#mimemagicfile">MimeMagicFile</a></code>) participate in this select process.
    Filename extensions that are only associated using the <code class="directive"><a href="#addhandler">AddHandler</a></code>, <code class="directive"><a href="#addinputfilter">AddInputFilter</a></code> or <code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code> directives may be included or excluded
    from matching by using the <code class="directive"><a href="#multiviewsmatch">MultiviewsMatch</a></code> directive.</p>

    <h3><a name="charset" id="charset">Charset</a></h3>
      <p>To convey this further information, Apache optionally sends
      a <code>Content-Language</code> header, to specify the language
      that the document is in, and can append additional information
      onto the <code>Content-Type</code> header to indicate the
      particular character set that should be used to correctly
      render the information.</p>

      <div class="example"><p><code>
Content-Language: en, fr
Content-Type: text/plain; charset=ISO-8859-1
      </code></p></div>

      <p>The language specification is the two-letter abbreviation
      for the language. The <code>charset</code> is the name of the
      particular character set which should be used.</p>
    
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddCharset" id="AddCharset">AddCharset</a> <a name="addcharset" id="addcharset">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extensions to the specified content
charset</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddCharset <var>charset</var> <var>extension</var>
[<var>extension</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">AddCharset</code> directive maps the given
    filename extensions to the specified content charset (the Internet
    registered name for a given character encoding). <var>charset</var>
    is the <a href="http://www.iana.org/assignments/character-sets">media
    type's charset parameter</a> for resources with filenames containing
    <var>extension</var>. This mapping is added to any already in force,
    overriding any mappings that already exist for the same
    <var>extension</var>.</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">AddLanguage ja .ja
AddCharset EUC-JP .euc
AddCharset ISO-2022-JP .jis
AddCharset SHIFT_JIS .sjis</pre>
</div>

    <p>Then the document <code>xxxx.ja.jis</code> will be treated
    as being a Japanese document whose charset is <code>ISO-2022-JP</code>
    (as will the document <code>xxxx.jis.ja</code>). The
    <code class="directive">AddCharset</code> 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 <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
    <var>extension</var> argument will be compared against each of
    them.</p>


<h3>See also</h3>
<ul>
<li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li>
<li><code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddEncoding" id="AddEncoding">AddEncoding</a> <a name="addencoding" id="addencoding">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extensions to the specified encoding
type</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddEncoding <var>encoding</var> <var>extension</var>
[<var>extension</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">AddEncoding</code> directive maps the given
    filename extensions to the specified HTTP content-encoding.
    <var>encoding</var> is the HTTP content coding to append to the
    value of the Content-Encoding header field for documents named with the
    <var>extension</var>. This mapping is added to any already in force,
    overriding any mappings that already exist for the same
    <var>extension</var>.</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">AddEncoding x-gzip .gz
AddEncoding x-compress .Z</pre>
</div>

    <p>This will cause filenames containing the <code>.gz</code> extension
    to be marked as encoded using the <code>x-gzip</code> encoding, and
    filenames containing the <code>.Z</code> extension to be marked as
    encoded with <code>x-compress</code>.</p>

    <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 <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
    <var>extension</var> argument will be compared against each of
    them.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddHandler" id="AddHandler">AddHandler</a> <a name="addhandler" id="addhandler">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the filename extensions to the specified
handler</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddHandler <var>handler-name</var> <var>extension</var>
[<var>extension</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>Files having the name <var>extension</var> will be served by the
    specified <var><a href="../handler.html">handler-name</a></var>. This
    mapping is added to any already in force, overriding any mappings that
    already exist for the same <var>extension</var>. For example, to
    activate CGI scripts with the file extension <code>.cgi</code>, you
    might use:</p>

    <pre class="prettyprint lang-config">AddHandler cgi-script .cgi</pre>


    <p>Once that has been put into your httpd.conf file, any file containing
    the <code>.cgi</code> extension will be treated as a CGI program.</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
    <var>extension</var> argument will be compared against each of
    them.</p>

<h3>See also</h3>
<ul>
<li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddInputFilter" id="AddInputFilter">AddInputFilter</a> <a name="addinputfilter" id="addinputfilter">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps filename extensions to the filters that will process
client requests</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddInputFilter <var>filter</var>[;<var>filter</var>...]
<var>extension</var> [<var>extension</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p><code class="directive">AddInputFilter</code> maps the filename extension
    <var>extension</var> to the <a href="../filter.html">filters</a> which
    will process client requests and POST input when they are received by
    the server. This is in addition to any filters defined elsewhere,
    including the <code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code>
    directive. This mapping is merged over any already in force, overriding
    any mappings that already exist for the same <var>extension</var>.</p>

    <p>If more than one <var>filter</var> is specified, they must be separated
    by semicolons in the order in which they should process the
    content. The <var>filter</var> is case-insensitive.</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
    <var>extension</var> argument will be compared against each of
    them.</p>


<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#removeinputfilter">RemoveInputFilter</a></code></li>
<li><code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddLanguage" id="AddLanguage">AddLanguage</a> <a name="addlanguage" id="addlanguage">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extension to the specified content
language</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddLanguage <var>language-tag</var> <var>extension</var>
[<var>extension</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">AddLanguage</code> directive maps the given
    filename extension to the specified content language.  Files with the
    filename <var>extension</var> are assigned an HTTP Content-Language
    value of <var>language-tag</var> corresponding to the language
    identifiers defined by RFC 3066.
    This directive overrides any mappings that already exist for the same
    <var>extension</var>.</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">AddEncoding x-compress .Z
AddLanguage en .en
AddLanguage fr .fr</pre>
</div>

    <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 <code class="directive">AddLanguage</code> 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 class="prettyprint lang-config">AddLanguage en .en
AddLanguage en-gb .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 <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
    <var>extension</var> argument will be compared against each of
    them.</p>

<h3>See also</h3>
<ul>
<li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddOutputFilter" id="AddOutputFilter">AddOutputFilter</a> <a name="addoutputfilter" id="addoutputfilter">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps filename extensions to the filters that will process
responses from the server</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilter <var>filter</var>[;<var>filter</var>...]
<var>extension</var> [<var>extension</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">AddOutputFilter</code> directive maps the
    filename extension <var>extension</var> to the <a href="../filter.html">filters</a> which will process responses
    from the server before they are sent to the client. This is in
    addition to any filters defined elsewhere, including <code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code> and <code class="directive"><a href="../mod/mod_filter.html#addoutputfilterbytype">AddOutputFilterByType</a></code> directive. This mapping is merged
    over any already in force, overriding any mappings that already exist
    for the same <var>extension</var>.</p>

    <p>For example, the following configuration will process all
    <code>.shtml</code> files for server-side includes and will then
    compress the output using <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>.</p>

    <pre class="prettyprint lang-config">AddOutputFilter INCLUDES;DEFLATE shtml</pre>


    <p>If more than one filter is specified, they must be separated
    by semicolons in the order in which they should process the
    content. The <var>filter</var> argument is case-insensitive.</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
    <var>extension</var> argument will be compared against each of
    them.</p>

    <p>Note that when defining a set of filters using the
    <code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code> directive,
    any definition made will replace any previous definition made by
    the <code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code>
    directive.</p>

    <pre class="prettyprint lang-config"># Effective filter "DEFLATE"
AddOutputFilter DEFLATE shtml
&lt;Location "/foo"&gt;
  # Effective filter "INCLUDES", replacing "DEFLATE"
  AddOutputFilter INCLUDES shtml
&lt;/Location&gt;
&lt;Location "/bar"&gt;
  # Effective filter "INCLUDES;DEFLATE", replacing "DEFLATE"
  AddOutputFilter INCLUDES;DEFLATE shtml
&lt;/Location&gt;
&lt;Location "/bar/baz"&gt;
  # Effective filter "BUFFER", replacing "INCLUDES;DEFLATE"
  AddOutputFilter BUFFER shtml
&lt;/Location&gt;
&lt;Location "/bar/baz/buz"&gt;
  # No effective filter, replacing "BUFFER"
  RemoveOutputFilter shtml
&lt;/Location&gt;</pre>


<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#removeoutputfilter">RemoveOutputFilter</a></code></li>
<li><code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="AddType" id="AddType">AddType</a> <a name="addtype" id="addtype">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps the given filename extensions onto the specified content
type</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddType <var>media-type</var> <var>extension</var>
[<var>extension</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">AddType</code> directive maps the given
    filename extensions onto the specified content
    type. <var>media-type</var> is the <a class="glossarylink" href="../glossary.html#media-type" title="see glossary">media
    type</a> to use for filenames containing
    <var>extension</var>. This mapping is added to any already in
    force, overriding any mappings that already exist for the same
    <var>extension</var>.</p>

    <div class="note">
      It is recommended that new media types be added using the
      <code class="directive">AddType</code> directive rather than changing the
      <code class="directive"><a href="#typesconfig">TypesConfig</a></code> file.
    </div>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">AddType image/gif .gif</pre>
</div>

    <p>Or, to specify multiple file extensions in one directive:</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">AddType image/jpeg jpeg jpg jpe</pre>
</div>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot. Filenames may have <a href="#multipleext">multiple extensions</a> and the
    <var>extension</var> argument will be compared against each of
    them.</p>

    <p>A similar effect to <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>'s
    <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>
    can be achieved by qualifying a <var>media-type</var> with
    <code>qs</code>:</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">AddType application/rss+xml;qs=0.8 .xml</pre>
</div>

    <p>This is useful in situations, <em>e.g.</em> when a client
    requesting <code>Accept: */*</code> can not actually processes
    the content returned by the server.</p>

    <p>This directive primarily configures the content types generated for
    static files served out of the filesystem.  For resources other than
    static files, where the generator of the response typically specifies
    a Content-Type, this directive has no effect.</p>


    <div class="note"><h3>Note</h3>
    <p>If no handler is explicitly set for a request, the specified content
    type will also be used as the handler name. </p>

    <p>When explicit directives such as
    <code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code> or
    <code class="directive"><a href="#addhandler">AddHandler</a></code> do not apply
    to the current request, the internal handler name normally set by those
    directives is instead set to the content type specified by this directive.
    </p>
    <p>
    This is a historical behavior that may be used by some third-party modules
    (such as mod_php) for taking responsibility for the matching request.
    </p>

    <p>Configurations that rely on such "synthetic" types should be avoided.
    Additionally, configurations that restrict access to
    <code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code> or
    <code class="directive"><a href="#addhandler">AddHandler</a></code> should
    restrict access to this directive as well.</p>
    </div>


<h3>See also</h3>
<ul>
<li><code class="directive"><a href="../mod/core.html#forcetype">ForceType</a></code></li>
<li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="DefaultLanguage" id="DefaultLanguage">DefaultLanguage</a> <a name="defaultlanguage" id="defaultlanguage">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Defines a default language-tag to be sent in the Content-Language
header field for all resources in the current context that have not been
assigned a language-tag by some other means.</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultLanguage <var>language-tag</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">DefaultLanguage</code> directive tells Apache
    that all resources in the directive's scope (<em>e.g.</em>, all resources
    covered by the current <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code> container) that don't have an explicit language
    extension (such as <code>.fr</code> or <code>.de</code> as configured
    by <code class="directive"><a href="#addlanguage">AddLanguage</a></code>) should be
    assigned a Content-Language of <var>language-tag</var>. This allows
    entire directory trees to be marked as containing Dutch content, for
    instance, without having to rename each file. Note that unlike using
    extensions to specify languages, <code class="directive">DefaultLanguage</code>
    can only specify a single language.</p>

    <p>If no <code class="directive">DefaultLanguage</code> directive is in force
    and a file does not have any language extensions as configured
    by <code class="directive"><a href="#addlanguage">AddLanguage</a></code>, then no
    Content-Language header field will be generated.</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">DefaultLanguage en</pre>
</div>

<h3>See also</h3>
<ul>
<li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ModMimeUsePathInfo" id="ModMimeUsePathInfo">ModMimeUsePathInfo</a> <a name="modmimeusepathinfo" id="modmimeusepathinfo">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Tells <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> to treat <code>path_info</code>
components as part of the filename</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ModMimeUsePathInfo On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ModMimeUsePathInfo Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">ModMimeUsePathInfo</code> directive is used to
    combine the filename with the <code>path_info</code> URL component to
    apply <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code>'s directives to the request. The default
    value is <code>Off</code> - therefore, the <code>path_info</code>
    component is ignored.</p>

    <p>This directive is recommended when you have a virtual filesystem.</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">ModMimeUsePathInfo On</pre>
</div>

    <p>If you have a request for <code>/index.php/foo.shtml</code>
    <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> will now treat the
    incoming request as <code>/index.php/foo.shtml</code> and directives
    like <code>AddOutputFilter INCLUDES .shtml</code> will add the
    <code>INCLUDES</code> filter to the request. If <code class="directive">ModMimeUsePathInfo</code> is not set, the
    <code>INCLUDES</code> filter will not be added. This will work
    analogously for virtual paths, such as those defined by
    <code class="directive">&lt;Location&gt;</code></p>

<h3>See also</h3>
<ul>
<li><code class="directive"><a href="../mod/core.html#acceptpathinfo">AcceptPathInfo</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="MultiviewsMatch" id="MultiviewsMatch">MultiviewsMatch</a> <a name="multiviewsmatch" id="multiviewsmatch">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The types of files that will be included when searching for
a matching file with MultiViews</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MultiviewsMatch Any|NegotiatedOnly|Filters|Handlers
[Handlers|Filters]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MultiviewsMatch NegotiatedOnly</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p><code class="directive">MultiviewsMatch</code> permits three different
    behaviors for <a href="mod_negotiation.html">mod_negotiation</a>'s
    Multiviews feature.  Multiviews allows a request for a file,
    <em>e.g.</em> <code>index.html</code>, to match any negotiated
    extensions following the base request, <em>e.g.</em>
    <code>index.html.en</code>, <code>index.html.fr</code>, or
    <code>index.html.gz</code>.</p>

    <p>The <code>NegotiatedOnly</code> option provides that every extension
    following the base name must correlate to a recognized
    <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> extension for content negotiation, <em>e.g.</em>
    Charset, Content-Type, Language, or Encoding.  This is the strictest
    implementation with the fewest unexpected side effects, and is the
    default behavior.</p>

    <p>To include extensions associated with Handlers and/or Filters,
    set the <code class="directive">MultiviewsMatch</code> directive to either
    <code>Handlers</code>, <code>Filters</code>, or both option keywords.
    If all other factors are equal, the smallest file will be served,
    <em>e.g.</em> in deciding between <code>index.html.cgi</code> of 500
    bytes and <code>index.html.pl</code> of 1000 bytes, the <code>.cgi</code>
    file would win in this example. Users of <code>.asis</code> files
    might prefer to use the Handler option, if <code>.asis</code> files are
    associated with the <code>asis-handler</code>.</p>

    <p>You may finally allow <code>Any</code> extensions to match, even if
    <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> doesn't recognize the extension. This can cause
    unpredictable results, such as serving .old or .bak files the webmaster
    never expected to be served.</p>

    <p>For example, the following configuration will allow handlers
    and filters to participate in Multviews, but will exclude unknown
    files:</p>

    <pre class="prettyprint lang-config">MultiviewsMatch Handlers Filters</pre>


    <p><code class="directive">MultiviewsMatch</code> is not allowed in a
    <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code> or <code class="directive"><a href="../mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code> section.</p>


<h3>See also</h3>
<ul>
<li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li>
<li><code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RemoveCharset" id="RemoveCharset">RemoveCharset</a> <a name="removecharset" id="removecharset">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any character set associations for a set of file
extensions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveCharset <var>extension</var> [<var>extension</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">RemoveCharset</code> directive removes any
    character set 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.</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot.</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">RemoveCharset .html .shtml</pre>
</div>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RemoveEncoding" id="RemoveEncoding">RemoveEncoding</a> <a name="removeencoding" id="removeencoding">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any content encoding associations for a set of file
extensions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveEncoding <var>extension</var> [<var>extension</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">RemoveEncoding</code> 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>

    <div class="example"><h3>/foo/.htaccess:</h3><pre class="prettyprint lang-config">AddEncoding x-gzip .gz
AddType text/plain .asc
&lt;Files "*.gz.asc"&gt;
    RemoveEncoding .gz
&lt;/Files&gt;</pre>
</div>

    <p>This will cause <code>foo.gz</code> to be marked as being
    encoded with the gzip method, but <code>foo.gz.asc</code> as an
    unencoded plaintext file.</p>

    <div class="note"><h3>Note</h3>
      <p><code class="directive">RemoveEncoding</code> directives are processed
      <em>after</em> any <code class="directive"><a href="#addencoding">AddEncoding</a></code>
      directives, so it is possible they may undo the effects of the latter
      if both occur within the same directory configuration.</p>
    </div>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RemoveHandler" id="RemoveHandler">RemoveHandler</a> <a name="removehandler" id="removehandler">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any handler associations for a set of file
extensions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveHandler <var>extension</var> [<var>extension</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">RemoveHandler</code> 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>

    <div class="example"><h3>/foo/.htaccess:</h3><pre class="prettyprint lang-config">AddHandler server-parsed .html</pre>
</div>

    <div class="example"><h3>/foo/bar/.htaccess:</h3><pre class="prettyprint lang-config">RemoveHandler .html</pre>
</div>

    <p>This has the effect of returning <code>.html</code> files in
    the <code>/foo/bar</code> directory to being treated as normal
    files, rather than as candidates for parsing (see the <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> module).</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RemoveInputFilter" id="RemoveInputFilter">RemoveInputFilter</a> <a name="removeinputfilter" id="removeinputfilter">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any input filter associations for a set of file
extensions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveInputFilter <var>extension</var> [<var>extension</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">RemoveInputFilter</code> directive removes any
    input <a href="../filter.html">filter</a> 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.</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot.</p>

<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#addinputfilter">AddInputFilter</a></code></li>
<li><code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RemoveLanguage" id="RemoveLanguage">RemoveLanguage</a> <a name="removelanguage" id="removelanguage">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any language associations for a set of file
extensions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveLanguage <var>extension</var> [<var>extension</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">RemoveLanguage</code> directive removes any
    language 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.</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RemoveOutputFilter" id="RemoveOutputFilter">RemoveOutputFilter</a> <a name="removeoutputfilter" id="removeoutputfilter">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any output filter associations for a set of file
extensions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveOutputFilter <var>extension</var> [<var>extension</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">RemoveOutputFilter</code> directive removes any
    output <a href="../filter.html">filter</a> 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.</p>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot.</p>

    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">RemoveOutputFilter shtml</pre>
</div>

<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#addoutputfilter">AddOutputFilter</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RemoveType" id="RemoveType">RemoveType</a> <a name="removetype" id="removetype">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Removes any content type associations for a set of file
extensions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RemoveType <var>extension</var> [<var>extension</var>]
...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">RemoveType</code> directive removes any
    <a class="glossarylink" href="../glossary.html#media-type" title="see glossary">media type</a> 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>

    <div class="example"><h3>/foo/.htaccess:</h3><pre class="prettyprint lang-config">RemoveType .cgi</pre>
</div>

    <p>This will remove any special handling of <code>.cgi</code>
    files in the <code>/foo/</code> directory and any beneath it,
    causing responses containing those files to omit the HTTP
    Content-Type header field.</p>

    <div class="note"><h3>Note</h3>
      <p><code class="directive">RemoveType</code> directives are processed
      <em>after</em> any <code class="directive"><a href="#addtype">AddType</a></code>
      directives, so it is possible they may undo the effects of the
      latter if both occur within the same directory configuration.</p>
    </div>

    <p>The <var>extension</var> argument is case-insensitive and can
    be specified with or without a leading dot.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="TypesConfig" id="TypesConfig">TypesConfig</a> <a name="typesconfig" id="typesconfig">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The location of the <code>mime.types</code> file</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TypesConfig <var>file-path</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TypesConfig conf/mime.types</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_mime</td></tr>
</table>
    <p>The <code class="directive">TypesConfig</code> directive sets the
    location of the <a class="glossarylink" href="../glossary.html#media-type" title="see glossary">media types</a>
    configuration file. <var>File-path</var> is relative to the
    <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>. This file sets
    the default list of mappings from filename extensions to content
    types. Most administrators use the <code>mime.types</code> file
    provided by their OS, which associates common filename
    extensions with the official list of IANA registered media types
    maintained at <a href="http://www.iana.org/assignments/media-types/index.html">http://www.iana.org/assignments/media-types/index.html</a>
    as well as a large number of unofficial types.  This
    simplifies the <code>httpd.conf</code> file by providing the
    majority of media-type definitions, and may be overridden by
    <code class="directive"><a href="#addtype">AddType</a></code> directives as
    needed. You should not edit the <code>mime.types</code> file,
    because it may be replaced when you upgrade your server.</p>

    <p>The file contains lines in the format of the arguments to
    an <code class="directive"><a href="#addtype">AddType</a></code> directive:</p>

    <div class="example"><p><code>
      <var>media-type</var> [<var>extension</var>] ...
    </code></p></div>

    <p>The case of the extension does not matter. Blank lines, and lines
    beginning with a hash character (<code>#</code>) are ignored.
    Empty lines are there for completeness (of the mime.types file).
    Apache httpd can still determine these types with <code class="module"><a href="../mod/mod_mime_magic.html">mod_mime_magic</a></code>.
    </p>

    <div class="note">
      Please do <strong>not</strong> send requests to the Apache HTTP
      Server Project to add any new entries in the distributed
      <code>mime.types</code> file unless (1) they are already
      registered with IANA, and (2) they use widely accepted,
      non-conflicting filename extensions across platforms.
      <code>category/x-subtype</code> requests will be automatically
      rejected, as will any new two-letter extensions as they will
      likely conflict later with the already crowded language and
      character set namespace.
    </div>

<h3>See also</h3>
<ul>
<li><code class="module"><a href="../mod/mod_mime_magic.html">mod_mime_magic</a></code></li>
</ul>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/mod/mod_mime.html" title="English">&nbsp;en&nbsp;</a> |
<a href="../fr/mod/mod_mime.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
<a href="../ja/mod/mod_mime.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
var comments_shortname = 'httpd';
var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_mime.html';
(function(w, d) {
    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
        d.write('<div id="comments_thread"><\/div>');
        var s = d.createElement('script');
        s.type = 'text/javascript';
        s.async = true;
        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
    }
    else { 
        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
    }
})(window, document);
//--><!]]></script></div><div id="footer">
<p class="apache">Copyright 2023 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
    prettyPrint();
}
//--><!]]></script>
</body></html>