home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / _572360BB5BA18C0454364D7C7C9179C7 < prev    next >
Extensible Markup Language  |  2007-09-13  |  62KB  |  979 lines

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