mod_imap.html revision 1e895b30bf4833c928334fad80fac8be169ab877
3770N/A<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
18N/A<html>
18N/A<head>
18N/A<title>Apache module mod_imap</title>
18N/A</head>
18N/A
18N/A<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
18N/A<BODY
18N/A BGCOLOR="#FFFFFF"
18N/A TEXT="#000000"
18N/A LINK="#0000FF"
18N/A VLINK="#000080"
18N/A ALINK="#FF0000"
18N/A>
18N/A<!--#include virtual="header.html" -->
18N/A<h1 ALIGN="CENTER">Module mod_imap</h1>
18N/A
18N/AThis module is contained in the <code>mod_imap.c</code> file, and is
18N/Acompiled in by default. It provides for <code>.map</code> files,
18N/Areplacing the functionality of the <code>imagemap</code> CGI
18N/Aprogram. Any directory or document type configured to use the handler
3770N/A<code>imap-file</code> (using either <code><A
18N/AHREF="mod_mime.html#addhandler">AddHandler</A> </code> or <code><A
18N/AHREF="mod_mime.html#sethandler">SetHandler</A></code>) will be
3533N/Aprocessed by this module.
18N/A
18N/A<h2>Summary</h2>
18N/A
18N/AThis module is in the default Apache distribution. The following directive will
18N/Aactivate files ending with <code>.map</code> as imagemap files:
3533N/A
18N/A<blockquote><code>AddHandler imap-file map</code></blockquote>
18N/A
42N/ANote that the following is still supported:
3533N/A
888N/A <blockquote><code>AddType application/x-httpd-imap map</code></blockquote>
888N/A
135N/AHowever, we are trying to phase out "magic MIME types" so we are deprecating
18N/Athis method.
136N/A
136N/A<H2>New Features</H2>
136N/AThe imagemap module adds some new features that were not
136N/Apossible with previously distributed imagemap programs.<P>
136N/A
136N/A<ul>
136N/A<LI>URL references relative to the Referer: information.
136N/A<LI>Default &lt;BASE&gt; assignment through a new map directive
3533N/A<code>base</code>.
3533N/A<LI>No need for <code>imagemap.conf</code> file.
3533N/A<LI>Point references.
3533N/A<LI>Configurable generation of imagemap menus.
3533N/A</ul>
3533N/A<P>
3533N/A
3533N/A<h2>Configuration Directives</h2>
3533N/A<ul>
3533N/A<li><A HREF="#imapmenu">ImapMenu</A>
3533N/A<li><A HREF="#imapdefault">ImapDefault</A>
3533N/A<li><A HREF="#imapbase">ImapBase</A>
3533N/A</ul>
3533N/A
3533N/A
3533N/A<p>
3533N/A
3533N/A<h3><A name="imapmenu">ImapMenu</A></h3>
3533N/A<strong>Syntax:</strong> ImapMenu <code>{none, formatted, semi-formatted,
3533N/A unformatted}</code><br>
3533N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3533N/A<Strong>Override:</strong> Indexes<br>
3533N/A<strong>Module:</strong> mod_imap.c<br>
3533N/A<strong>Compatibility:</strong> ImapMenu is only available in Apache
3533N/A1.1 and later.<p>
3533N/A
3533N/AThe ImapMenu directive determines the action taken if an imagemap file
3533N/Ais called without valid coordinates.
3533N/A<dl>
3533N/A <dt><code>none</code>
3533N/A <dd>If ImapMenu is
3533N/A <code>none</code>, no menu is generated, and the <code>default</code>
3533N/A action is performed.
3533N/A <dt><code>formatted</code>
3533N/A <dd>A <code>formatted</code> menu is the simplest menu. Comments
3533N/A in the imagemap file are ignored. A level one header is
136N/A printed, then an hrule, then the links each on a separate line.
135N/A The menu has a consistent, plain look close to that of
3533N/A a directory listing.
3533N/A <dt><code>semiformatted</code>
3533N/A <dd>In the <code>semiformatted</code> menu, comments are printed
3533N/A where they occur in the imagemap file. Blank lines are turned
3533N/A into HTML breaks. No header or hrule is printed, but otherwise
3533N/A the menu is the same as a <code>formatted</code> menu.
3533N/A <dt><code>unformatted</code>
844N/A <dd>Comments are printed, blank lines are ignored. Nothing is
844N/A printed that does not appear in the imagemap file. All breaks
844N/A and headers must be included as comments in the imagemap file.
844N/A This gives you the most flexibility over the appearance of your
18N/A menus, but requires you to treat your map files as HTML instead
18N/A of plaintext.
18N/A</dl>
18N/A
18N/A<p>
18N/A
137N/A<h3><A name="imapdefault">ImapDefault</A></h3>
137N/A<strong>Syntax:</strong> ImapDefault <code>{error, nocontent,
137N/A map, referer, URL}</code><br>
137N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
137N/A<Strong>Override:</strong> Indexes<br>
137N/A<strong>Module:</strong> mod_imap.c<br>
18N/A<strong>Compatibility:</strong> ImapDefault is only available in Apache
18N/A1.1 and later.<p>
18N/A
18N/A
58N/AThe ImapDefault directive sets the default <code>default</code> used in
18N/Athe imagemap files. It's value is overridden by a <code>default</code>
135N/Adirective within the imagemap file. If not present, the
3533N/A<code>default</code> action is <code>nocontent</code>, which means
3533N/Athat a <code>204 No Content</code> is sent to the client. In this
3533N/Acase, the client should continue to display the original page.
135N/A
135N/A<p>
136N/A
136N/A<h3><A name="imapbase">ImapBase</A></h3>
135N/A<strong>Syntax:</strong> ImapBase <code>{map, referer, URL}</code><br>
135N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
135N/A<Strong>Override:</strong> Indexes<br>
135N/A<strong>Module:</strong> mod_imap.c<br>
135N/A<strong>Compatibility:</strong> ImapBase is only available in Apache
3533N/A1.1 and later.<p>
3533N/A
3533N/AThe ImapBase directive sets the default <code>base</code> used in
135N/Athe imagemap files. It's value is overridden by a <code>base</code>
135N/Adirective within the imagemap file. If not present, the
135N/A<code>base</code> defaults to <code>http://servername/</code>.
135N/A
135N/A<hr>
135N/A<p>
844N/A
135N/A<h2>Imagemap File</h2>
135N/AThe lines in the imagemap files can have one of several formats:
135N/A<blockquote>
137N/A<code>directive value [x,y ...]</code><br>
135N/A<code>directive value "Menu text" [x,y ...]</code><br>
135N/A<code>directive value x,y ... "Menu text"</code><br>
844N/A</blockquote>
844N/AThe directive is one of <code>base</code>, <code>default</code>,
135N/A<code>poly</code>, <code>circle</code>, <code>rect</code>, or
135N/A<code>point</code>. The value is an absolute or relative URL, or one
136N/Aof the special values listed below. The coordinates are
136N/A<code>x,y</code> pairs separated by whitespace. The quoted text is
135N/Aused as the text of the link if a imagemap menu is generated. Lines
135N/Abeginning with '#' are comments.
135N/A
135N/A<h3>Imagemap File Directives</h3>
3533N/AThere are six directives allowed in the imagemap file. The directives
3533N/Acan come in any order, but are processed in the order they are found
3533N/Ain the imagemap file.
3533N/A<dl>
3533N/A<dt><code>base</code> Directive
3533N/A<dd>Has the effect of <code>&lt;BASE href="value"&gt;</code>. The
18N/A non-absolute URLs of the map-file are taken relative to this value.
18N/A The <code>base</code> directive overrides ImapBase as set in a
42N/A .htaccess file or in the server configuration files. In the absence
42N/A of an ImapBase configuration directive, <code>base</code> defaults to
136N/A <code>http://server_name/</code>. <br>
3533N/A <code>base_uri</code> is synonymous with <code>base</code>. Note that
3533N/A a trailing slash on the URL is significant.
18N/A<p>
18N/A<dt><code>default</code> Directive
212N/A<dd>The action taken if the coordinates given do not fit any of the
212N/A <code>poly</code>, <code>circle</code> or <code>rect</code>
3533N/A directives, and there are no <code>point</code> directives. Defaults
3533N/A to <code>nocontent</code> in the absence of an ImapDefault
212N/A configuration setting, causing a status code of <code>204 No
212N/A Content</code> to be returned. The client should keep the same
18N/A page displayed.
42N/A<p>
18N/A<dt><code>poly</code> Directive
42N/A<dd>Takes three to one-hundred points, and is obeyed if the user selected
18N/A coordinates fall within the polygon defined by these points.
136N/A<p>
3533N/A<dt><code>circle</code>
3533N/A<dd>Takes the center coordinates of a circle and a point on the circle. Is
42N/A obeyed if the user selected point is with the circle.
42N/A<p>
42N/A<dt><code>rect</code> Directive
42N/A<dd>Takes the coordinates of two opposing corners of a rectangle. Obeyed
42N/A if the point selected is within this rectangle.
42N/A<p>
42N/A<dt><code>point</code> Directive
42N/A<dd>Takes a single point. The point directive closest to the user
42N/A selected point is obeyed if no other directives are satisfied.
42N/A Note that <code>default</code> will not be followed if a
42N/A <code>point</code> directive is present and valid coordinates are
18N/A given.
18N/A</dl>
18N/A
18N/A
42N/A
3533N/A<h3>Values</h3>
3533N/AThe values for each of the directives can any of the following:
3533N/A<dl>
3533N/A <dt>a URL
3533N/A <dd>The URL can be relative or absolute URL. Relative URLs can
3533N/A contain '..' syntax and will be resolved relative to the
18N/A <code>base</code> value. <br>
18N/A <code>base</code> itself will not resolved according to the current
42N/A value. A statement <code>base mailto:</code> will work properly, though.
42N/A<p>
42N/A <dt><code>map</code>
42N/A <dd>Equivalent to the URL of the imagemap file itself. No
42N/A coordinates are sent with this, so a menu will be generated
42N/A unless ImapMenu is set to 'none'.
42N/A<p>
42N/A <dt><code>menu</code>
42N/A <dd>Synonymous with <code>map</code>.
42N/A<p>
42N/A <dt><code>referer</code>
42N/A <dd>Equivalent to the URL of the referring document.
42N/A Defaults to <code>http://servername/</code> if no Referer:
42N/A header was present.
42N/A<p>
42N/A <dt><code>nocontent</code>
42N/A <dd>Sends a status code of <code>204 No Content</code>,
18N/A telling the client to keep the same page displayed. Valid for
18N/A all but <code>base</code>.
18N/A<p>
3533N/A <dt><code>error</code>
3533N/A <dd>Fails with a <code>500 Server Error</code>. Valid for all but
3533N/A <code>base</code>, but sort of silly for anything but
3533N/A <code>default</code>.
3533N/A</dl>
3533N/A
3533N/A<h3>Coordinates</h3>
3533N/A<dl>
3533N/A <dt><code>0,0 200,200</code>
3533N/A <dd>A coordinate consists of an <tt>x</tt> and a <tt>y</tt> value
3533N/A separated by a comma. The coordinates are separated from each other
3533N/A by whitespace. To accommodate the way Lynx handles imagemaps, should a
3533N/A user select the coordinate <code>0,0</code>, it is as if
3533N/A no coordinate had been selected.
3533N/A</dl>
3533N/A
3533N/A<h3>Quoted Text</h3>
3533N/A<dl>
3533N/A <dt><code>"Menu Text"</code>
3533N/A <dd>After the value or after the coordinates, the line optionally may
3533N/A contain text within double quotes. This string is used as the
3533N/A text for the link if a menu is generated:<br>
3533N/A <code>&lt;a href="http://foo.com/"&gt;Menu text&lt;/a&gt;</code><br>
3533N/A If no quoted text is present, the name of the link will be used
3533N/A as the text:<br>
3533N/A <code>&lt;a href="http://foo.com/"&gt;http://foo.com&lt;/a&gt;</code><br>
3533N/A It is impossible to escape double quotes within this text.
3533N/A</dl>
3533N/A
3533N/A<hr>
3533N/A
3533N/A<h2>Example Mapfile</h2>
3533N/A<blockquote><code>
3533N/A#Comments are printed in a 'formatted' or 'semiformatted' menu. <br>
3533N/A#And can contain html tags. &lt;hr&gt; <br>
3533N/Abase referer <br>
3533N/Apoly map "Could I have a menu, please?" 0,0 0,10 10,10 10,0 <br>
3533N/Arect .. 0,0 77,27 "the directory of the referer"<br>
3533N/Acircle http://www.inetnebr.com/lincoln/feedback/ 195,0 305,27 <br>
3533N/Arect another_file "in same directory as referer" 306,0 419,27 <br>
3533N/Apoint http://www.zyzzyva.com/ 100,100 <br>
3533N/Apoint http://www.tripod.com/ 200,200 <br>
18N/Arect mailto:nate@tripod.com 100,150 200,0 "Bugs?" <br>
3533N/A</code></blockquote>
3533N/A<P>
3533N/A
18N/A<h2>Referencing your mapfile</h2>
18N/A<blockquote><code>
18N/A&lt;A HREF="/maps/imagmap1.map"&gt; <br>
18N/A&lt;IMG ISMAP SRC="/images/imagemap1.gif"&gt; <br>
18N/A&lt;/A&gt;
18N/A</code></blockquote><p>
18N/A
18N/A<!--#include virtual="footer.html" -->
42N/A</BODY>
42N/A</HTML>
42N/A
42N/A
3533N/A