mod_mime.html revision f3789af1554b685244e4f3a51af953abd909103c
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai BGCOLOR="#FFFFFF"
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai TEXT="#000000"
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai LINK="#0000FF"
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai VLINK="#000080"
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai ALINK="#FF0000"
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<!--#include virtual="header.html" -->
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiThis module is contained in the <CODE>mod_mime.c</CODE> file, and is
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaicompiled in by default. It provides for determining the types of files
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaifrom the filename.
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiThis module is used to determine various bits of "meta information"
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiabout documents. This information relates to the content of the
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaidocument and is returned to the browser or used in content-negotiation
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiwithin the server. In addition, a "handler" can be set for a document,
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiwhich determines how the document will be processed within the server.
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiThe directives <a href="#addcharset">AddCharset</a>,
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<A HREF="#addencoding">AddEncoding</A>, <A HREF="#addhandler">AddHandler</A>,
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<A HREF="#addlanguage">AddLanguage</A> and <A HREF="#addtype">AddType</A>
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiare all used to map file extensions onto the meta-information for that
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaifile. Respectively they set the character set, content-encoding, handler,
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaicontent-language, and MIME-type (content-type) of documents. The
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaidirective <A HREF="#typesconfig">TypesConfig</A> is used to specify a
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaifile which also maps extensions onto MIME types. The directives <A
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiHREF="#sethandler">SetHandler</A> are used to associated all the files
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiin a given location (<EM>e.g.</EM>, a particular directory) onto a particular
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiMIME type or handler.
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiNote that changing the type or encoding of a file does not change the
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaivalue of the <CODE>Last-Modified</CODE> header. Thus, previously cached
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaicopies may still be used by a client or proxy, with the previous headers.
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<H2><A NAME="multipleext">Files with Multiple Extensions</A></H2>
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiFiles can have more than one extension, and the order of the
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiextensions is <EM>normally</EM> irrelevant. For example, if the file
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<CODE>welcome.html.fr</CODE> maps onto content type text/html and
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavailanguage French then the file <CODE>welcome.fr.html</CODE> will map
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaionto exactly the same information. The only exception to this is if an
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiextension is given which Apache does not know how to handle. In this
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaicase it will "forget" about any information it obtained from
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiextensions to the left of the unknown extension. So, for example, if
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaithe extensions fr and html are mapped to the appropriate language and
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaitype but extension xxx is not assigned to anything, then the file
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavai<CODE>welcome.fr.xxx.html</CODE> will be associated with content-type
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiIf more than one extension is given which maps onto the same type of
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaimeta-information, then the one to the right will be used. For example,
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiif ".gif" maps to the MIME-type image/gif and ".html" maps to the
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiMIME-type text/html, then the file <CODE>welcome.gif.html</CODE> will
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaibe associated with the MIME-type "text/html".
4eaa471005973e11a6110b69fe990530b3b95a38Rishi SrivatsavaiCare should be taken when a file with multiple extensions gets
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaiassociated with both a MIME-type and a handler. This will usually
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavairesult in the request being by the module associated with the
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaihandler. For example, if the <CODE>.imap</CODE> extension is mapped to
4eaa471005973e11a6110b69fe990530b3b95a38Rishi Srivatsavaithe handler "imap-file" (from mod_imap) and the <CODE>.html</CODE>
HREF="directive-dict.html#Override"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Override"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Override"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Compatibility"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Override"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Override"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Override"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Compatibility"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Compatibility"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Compatibility"
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
HREF="directive-dict.html#Compatibility"
called, you might put the following into access.conf:
HREF="directive-dict.html#Syntax"
HREF="directive-dict.html#Default"
HREF="directive-dict.html#Context"
HREF="directive-dict.html#Status"
HREF="directive-dict.html#Module"
<!--#include virtual="footer.html" -->