mod_mime.html revision f3789af1554b685244e4f3a51af953abd909103c
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<HTML>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<HEAD>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<TITLE>Apache module mod_mime</TITLE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</HEAD>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<BODY
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby BGCOLOR="#FFFFFF"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby TEXT="#000000"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby LINK="#0000FF"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby VLINK="#000080"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby ALINK="#FF0000"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<!--#include virtual="header.html" -->
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H1 ALIGN="CENTER">Module mod_mime</H1>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThis module is contained in the <CODE>mod_mime.c</CODE> file, and is
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycompiled in by default. It provides for determining the types of files
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfrom the filename.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2>Summary</H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThis module is used to determine various bits of "meta information"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyabout documents. This information relates to the content of the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbydocument and is returned to the browser or used in content-negotiation
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbywithin the server. In addition, a "handler" can be set for a document,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbywhich determines how the document will be processed within the server.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThe directives <a href="#addcharset">AddCharset</a>,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="#addencoding">AddEncoding</A>, <A HREF="#addhandler">AddHandler</A>,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="#addlanguage">AddLanguage</A> and <A HREF="#addtype">AddType</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyare all used to map file extensions onto the meta-information for that
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfile. Respectively they set the character set, content-encoding, handler,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycontent-language, and MIME-type (content-type) of documents. The
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbydirective <A HREF="#typesconfig">TypesConfig</A> is used to specify a
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfile which also maps extensions onto MIME types. The directives <A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyHREF="#forcetype">ForceType</A> and <A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyHREF="#sethandler">SetHandler</A> are used to associated all the files
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyin a given location (<EM>e.g.</EM>, a particular directory) onto a particular
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyMIME type or handler.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyNote that changing the type or encoding of a file does not change the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyvalue of the <CODE>Last-Modified</CODE> header. Thus, previously cached
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycopies may still be used by a client or proxy, with the previous headers.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2><A NAME="multipleext">Files with Multiple Extensions</A></H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyFiles can have more than one extension, and the order of the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyextensions is <EM>normally</EM> irrelevant. For example, if the file
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<CODE>welcome.html.fr</CODE> maps onto content type text/html and
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbylanguage French then the file <CODE>welcome.fr.html</CODE> will map
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyonto exactly the same information. The only exception to this is if an
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyextension is given which Apache does not know how to handle. In this
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycase it will "forget" about any information it obtained from
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyextensions to the left of the unknown extension. So, for example, if
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe extensions fr and html are mapped to the appropriate language and
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbytype but extension xxx is not assigned to anything, then the file
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<CODE>welcome.fr.xxx.html</CODE> will be associated with content-type
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbytext/html but <EM>no</EM> language.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyIf more than one extension is given which maps onto the same type of
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbymeta-information, then the one to the right will be used. For example,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyif ".gif" maps to the MIME-type image/gif and ".html" maps to the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyMIME-type text/html, then the file <CODE>welcome.gif.html</CODE> will
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbybe associated with the MIME-type "text/html".
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyCare should be taken when a file with multiple extensions gets
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyassociated with both a MIME-type and a handler. This will usually
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyresult in the request being by the module associated with the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyhandler. For example, if the <CODE>.imap</CODE> extension is mapped to
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe handler "imap-file" (from mod_imap) and the <CODE>.html</CODE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyextension is mapped to the MIME-type "text/html", then the file
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<CODE>world.imap.html</CODE> will be associated with both the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby"imap-file" handler and "text/html" MIME-type. When it is processed,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe "imap-file" handler will be used, and so it will be treated as a
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbymod_imap imagemap file.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2>Directives</H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<UL>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<li><a href="#addcharset">AddCharset</a></li>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#addencoding">AddEncoding</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#addhandler">AddHandler</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#addlanguage">AddLanguage</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#addtype">AddType</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#defaultlanguage">DefaultLanguage</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#forcetype">ForceType</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#removehandler">RemoveHandler</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#sethandler">SetHandler</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<LI><A HREF="#typesconfig">TypesConfig</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</UL>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<HR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2><A NAME="addcharset">AddCharset</A></H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="directive-dict.html#Syntax" REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Syntax:</STRONG></A> AddCharset <i>charset extension
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby [extension...]</i><br>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="directive-dict.html#Context" REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Context:</STRONG></A> server config, virtual host, directory, .htaccess<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Override"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Override:</STRONG></A> FileInfo<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Status"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Status:</STRONG></A> Base<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Module"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Module:</STRONG></A> mod_mime
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<br>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="directive-dict.html#Compatibility" REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Compatibility:</STRONG></A> AddCharset is only available in Apache
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby1.3.10 and later
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThe AddCharset directive maps the given filename extensions to the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyspecified content charset. <i>charset</i> is the MIME charset
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyparameter of filenames containing <i>extension</i>. This mapping is
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyadded to any already in force, overriding any mappings that already
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyexist for the same <i>extension</i>.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyExample:
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<pre>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddLanguage ja .ja
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddCharset EUC-JP .euc
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddCharset ISO-2022-JP .jis
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddCharset SHIFT_JIS .sjis
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</pre>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThen the document <samp>xxxx.ja.jis</samp> will be treated as being a
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyJapanese document whose charset is ISO-2022-JP (as will the document
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<samp>xxxx.jis.ja</samp>). Although the content charset is reported to
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe client, the browser is unlikely to use this information. The
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyAddCharset directive is more useful for
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="/content-negotiation.html">content negotiation</A>, where
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe server returns one from several documents based on the client's
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycharset preference.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<STRONG>See also</STRONG>: <A HREF="mod_negotiation.html">mod_negotiation</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<hr>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2><A NAME="addencoding">AddEncoding</A></H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<!--%plaintext &lt;?INDEX {\tt AddEncoding} directive&gt; -->
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Syntax"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Syntax:</STRONG></A> AddEncoding <EM>MIME-enc extension extension...</EM><BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Context"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Context:</STRONG></A> server config, virtual host, directory, .htaccess<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Override"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Override:</STRONG></A> FileInfo<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Status"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Status:</STRONG></A> Base<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Module"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Module:</STRONG></A> mod_mime<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThe AddEncoding directive maps the given filename extensions to the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyspecified encoding type. <EM>MIME-enc</EM> is the MIME encoding to use
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfor documents containing the <EM>extension</EM>. This mapping is added
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyto any already in force, overriding any mappings that already exist
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfor the same <EM>extension</EM>.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyExample:
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<BLOCKQUOTE><CODE> AddEncoding x-gzip gz<BR> AddEncoding x-compress Z
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</CODE></BLOCKQUOTE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThis will cause filenames containing the .gz extension to be marked as
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyencoded using the x-gzip encoding, and filenames containing the .Z
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyextension to be marked as encoded with x-compress.<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyOld clients expect <CODE>x-gzip</CODE> and <CODE>x-compress</CODE>,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyhowever the standard dictates that they're equivalent to <CODE>gzip</CODE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyand <CODE>compress</CODE> respectively. Apache does content encoding
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycomparisons by ignoring any leading <CODE>x-</CODE>. When responding
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbywith an encoding Apache will use whatever form (<EM>i.e.</EM>, <CODE>x-foo</CODE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyor <CODE>foo</CODE>) the client requested. If the client didn't
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyspecifically request a particular form Apache will use the form given by
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe <CODE>AddEncoding</CODE> directive. To make this long story short,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyyou should always use <CODE>x-gzip</CODE> and <CODE>x-compress</CODE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfor these two specific encodings. More recent encodings, such as
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<CODE>deflate</CODE> should be specified without the <CODE>x-</CODE>.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<STRONG>See also</STRONG>: <A HREF="#multipleext">Files with
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbymultiple extensions</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P><HR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2><A NAME="addhandler">AddHandler</A></H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Syntax"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Syntax:</STRONG></A> AddHandler <EM>handler-name extension extension...</EM><BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Context"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Context:</STRONG></A> server config, virtual host, directory, .htaccess<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Override"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Override:</STRONG></A> FileInfo<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Status"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Status:</STRONG></A> Base<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Module"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Module:</STRONG></A> mod_mime<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Compatibility"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Compatibility:</STRONG></A> AddHandler is only available in Apache
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby1.1 and later<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>AddHandler maps the filename extensions <EM>extension</EM> to the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="/handler.html">handler</A> <EM>handler-name</EM>. This
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbymapping is added to any already in force, overriding any mappings that
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyalready exist for the same <EM>extension</EM>.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyFor example, to activate CGI scripts
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbywith the file extension "<CODE>.cgi</CODE>", you might use:
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<PRE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddHandler cgi-script cgi
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</PRE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>Once that has been put into your srm.conf or httpd.conf file, any
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfile containing the "<CODE>.cgi</CODE>" extension will be treated as a
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyCGI program.</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<STRONG>See also</STRONG>: <A HREF="#multipleext">Files with
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbymultiple extensions</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<HR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2><A NAME="addlanguage">AddLanguage</A></H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<!--%plaintext &lt;?INDEX {\tt AddLanguage} directive&gt; -->
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Syntax"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Syntax:</STRONG></A> AddLanguage <EM>MIME-lang extension extension...</EM><BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Context"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Context:</STRONG></A> server config, virtual host, directory, .htaccess<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Override"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Override:</STRONG></A> FileInfo<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Status"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Status:</STRONG></A> Base<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Module"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Module:</STRONG></A> mod_mime
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThe AddLanguage directive maps the given filename extensions to the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyspecified content language. <EM>MIME-lang</EM> is the MIME language of
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfilenames containing <EM>extension</EM>. This mapping is added to any
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyalready in force, overriding any mappings that already exist for the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbysame <EM>extension</EM>.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyExample: <BLOCKQUOTE><CODE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyAddEncoding x-compress Z<BR> AddLanguage en .en<BR> AddLanguage fr
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby.fr<BR> </CODE></BLOCKQUOTE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThen the document <CODE>xxxx.en.Z</CODE> will be treated as being a
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycompressed English document (as will the document
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<CODE>xxxx.Z.en</CODE>). Although the content language is reported to
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe client, the browser is unlikely to use this information. The
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyAddLanguage directive is more useful for
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A HREF="/content-negotiation.html">content negotiation</A>, where
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe server returns one from several documents based on the client's
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbylanguage preference.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyIf multiple language assignments are made for the same extension,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbythe last one encountered is the one that is used. That is, for the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbycase of:
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<PRE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddLanguage en .en
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddLanguage en-uk .en
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby AddLanguage en-us .en
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</PRE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbydocuments with the extension "<CODE>.en</CODE>" would be treated as
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbybeing "<CODE>en-us</CODE>".
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<STRONG>See also</STRONG>: <A HREF="#multipleext">Files with
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbymultiple extensions</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<STRONG>See also</STRONG>: <A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyHREF="/mod_negotiation.html">mod_negotiation</A>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<HR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<H2><A NAME="addtype">AddType</A></H2>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<!--%plaintext &lt;?INDEX {\tt AddType} directive&gt; -->
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Syntax"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Syntax:</STRONG></A> AddType <EM>MIME-type extension extension...</EM><BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Context"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Context:</STRONG></A> server config, virtual host, directory, .htaccess<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Override"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Override:</STRONG></A> FileInfo<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Status"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Status:</STRONG></A> Base<BR>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby HREF="directive-dict.html#Module"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby REL="Help"
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby><STRONG>Module:</STRONG></A> mod_mime<P>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyThe AddType directive maps the given filename extensions onto the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyspecified content type. <EM>MIME-enc</EM> is the MIME type to use for
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyfilenames containing <EM>extension</EM>. This mapping is added to any
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyalready in force, overriding any mappings that already exist for the
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbysame <EM>extension</EM>. This directive can be used to add mappings
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbynot listed in the MIME types file (see the <CODE><A
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyHREF="#typesconfig">TypesConfig</A></CODE> directive).
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyExample:
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby<BLOCKQUOTE><CODE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyAddType image/gif GIF
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby</CODE></BLOCKQUOTE>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyIt is recommended that new MIME types be added using the AddType directive
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyrather than changing the <A HREF="#typesconfig">TypesConfig</A> file.<P>
Note that, unlike the NCSA httpd, this directive cannot be used to set the
type of particular files.<P>
<P>
<STRONG>See also</STRONG>: <A HREF="#multipleext">Files with
multiple extensions</A>
<HR>
<H2><A NAME="defaultlanguage">DefaultLanguage</A></H2>
<!--%plaintext &lt;?INDEX {\tt DefaultLanguage} directive&gt; -->
<A
HREF="directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> DefaultLanguage <EM>MIME-lang</EM><BR>
<A
HREF="directive-dict.html#Context"
REL="Help"
><STRONG>Context:</STRONG></A> server config, virtual host, directory, .htaccess<BR>
<A
HREF="directive-dict.html#Override"
REL="Help"
><STRONG>Override:</STRONG></A> FileInfo<BR>
<A
HREF="directive-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Base<BR>
<A
HREF="directive-dict.html#Module"
REL="Help"
><STRONG>Module:</STRONG></A> mod_mime<BR>
<A
HREF="directive-dict.html#Compatibility"
REL="Help"
><STRONG>Compatibility:</STRONG></A> DefaultLanguage is only available in Apache
1.3.4 and later.<P>
The DefaultLanguage directive tells Apache that all files in the
directive's scope (<EM>e.g.</EM>, all files covered by the current
<CODE>&lt;Directory&gt;</CODE> container) that don't have an explicit
language extension (such as <SAMP>.fr</SAMP> or <SAMP>.de</SAMP> as
configured by <SAMP>AddLanguage</SAMP>) should be considered to be in
the specified <EM>MIME-lang</EM> language. This allows entire
directories to be marked as containing Dutch content, for instance,
without having to rename each file. Note that unlike using extensions
to specify languages, <SAMP>DefaultLanguage</SAMP> can only specify a
single language.
<P>
If no <SAMP>DefaultLanguage</SAMP> directive is in force, and a file
does not have any language extensions as configured by
<SAMP>AddLanguage</SAMP>, then that file will be considered to have no
language attribute.
<P>
<STRONG>See also</STRONG>: <A
HREF="/mod_negotiation.html">mod_negotiation</A>
<BR>
<STRONG>See also</STRONG>: <A HREF="#multipleext">Files with
multiple extensions</A>
<HR>
<H2><A NAME="forcetype">ForceType</A></H2>
<A
HREF="directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> ForceType <EM>media type</EM><BR>
<A
HREF="directive-dict.html#Context"
REL="Help"
><STRONG>Context:</STRONG></A> directory, .htaccess<BR>
<A
HREF="directive-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Base<BR>
<A
HREF="directive-dict.html#Module"
REL="Help"
><STRONG>Module:</STRONG></A> mod_mime<BR>
<A
HREF="directive-dict.html#Compatibility"
REL="Help"
><STRONG>Compatibility:</STRONG></A> ForceType is only available in Apache
1.1 and later.<P>
<P>When placed into an <CODE>.htaccess</CODE> file or a
<CODE>&lt;Directory&gt;</CODE> or <CODE>&lt;Location&gt;</CODE> section,
this directive forces all matching files to be served
as the content type given by <EM>media type</EM>. For example, if you
had a directory full of GIF files, but did not want to label them all with
".gif", you might want to use:
<PRE>
ForceType image/gif
</PRE>
<P>Note that this will override any filename extensions that might determine
the media type.</P><HR>
<H2><A NAME="removehandler">RemoveHandler</A></H2>
<A
HREF="directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> RemoveHandler <EM>extension extension...</EM><BR>
<A
HREF="directive-dict.html#Context"
REL="Help"
><STRONG>Context:</STRONG></A> directory, .htaccess<BR>
<A
HREF="directive-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Base<BR>
<A
HREF="directive-dict.html#Module"
REL="Help"
><STRONG>Module:</STRONG></A> mod_mime<BR>
<A
HREF="directive-dict.html#Compatibility"
REL="Help"
><STRONG>Compatibility:</STRONG></A> RemoveHandler is only available in Apache
1.3.4 and later.<P>
<P>
The <SAMP>RemoveHandler</SAMP> directive removes any
handler associations for files with the given extensions.
This allows <CODE>.htaccess</CODE> files in subdirectories to undo
any associations inherited from parent directories or the server
config files. An example of its use might be:
</P>
<DL>
<DT><CODE>/foo/.htaccess:</CODE></DT>
<DD><CODE>AddHandler server-parsed .html</CODE></DD>
<DT><CODE>/foo/bar/.htaccess:</CODE></DT>
<DD><CODE>RemoveHandler .html</CODE></DD>
</DL>
<P>
This has the effect of returning <SAMP>.html</SAMP> files in the
<SAMP>/foo/bar</SAMP> directory to being treated as normal
files, rather than as candidates for parsing (see the
<A HREF="mod_include.html"><SAMP>mod_include</SAMP></A> module).
</P>
<HR>
<H2><A NAME="sethandler">SetHandler</A></H2>
<A
HREF="directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> SetHandler <EM>handler-name</EM><BR>
<A
HREF="directive-dict.html#Context"
REL="Help"
><STRONG>Context:</STRONG></A> directory, .htaccess<BR>
<A
HREF="directive-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Base<BR>
<A
HREF="directive-dict.html#Module"
REL="Help"
><STRONG>Module:</STRONG></A> mod_mime<BR>
<A
HREF="directive-dict.html#Compatibility"
REL="Help"
><STRONG>Compatibility:</STRONG></A> SetHandler is only available in Apache
1.1 and later.<P>
<P>When placed into an <CODE>.htaccess</CODE> file or a
<CODE>&lt;Directory&gt;</CODE> or <CODE>&lt;Location&gt;</CODE> section,
this directive forces all matching files to be parsed through the
<A HREF="/handler.html">handler</A>
given by <EM>handler-name</EM>. For example, if you had a
directory you wanted to be parsed entirely as imagemap rule files,
regardless of extension, you might put the following into an
<CODE>.htaccess</CODE> file in that directory:
<PRE>
SetHandler imap-file
</PRE>
<P>Another example: if you wanted to have the server display a status
report whenever a URL of <CODE>http://servername/status</CODE> was
called, you might put the following into access.conf:
<PRE>
&lt;Location /status&gt;
SetHandler server-status
&lt;/Location&gt;
</PRE>
<HR>
<H2><A NAME="typesconfig">TypesConfig</A></H2>
<!--%plaintext &lt;?INDEX {\tt TypesConfig} directive&gt; -->
<A
HREF="directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> TypesConfig <EM>filename</EM><BR>
<A
HREF="directive-dict.html#Default"
REL="Help"
><STRONG>Default:</STRONG></A> <CODE>TypesConfig conf/MIME.types</CODE><BR>
<A
HREF="directive-dict.html#Context"
REL="Help"
><STRONG>Context:</STRONG></A> server config<BR>
<A
HREF="directive-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Base<BR>
<A
HREF="directive-dict.html#Module"
REL="Help"
><STRONG>Module:</STRONG></A> mod_mime<P>
The TypesConfig directive sets the location of the MIME types configuration
file. <EM>Filename</EM> is relative to the
<A HREF="core.html#serverroot">ServerRoot</A>. This file sets the default list of
mappings from filename extensions to content types; changing this file is not
recommended. Use the <A HREF="#addtype">AddType</A> directive instead. The
file contains lines in the format of the arguments to an AddType command:
<BLOCKQUOTE><EM>MIME-type extension extension ...</EM></BLOCKQUOTE>
The extensions are lower-cased. Blank lines, and lines beginning with a hash
character (`#') are ignored.<P>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>