]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_imagemap.html.en
Documentation rebuild after recent commits
[apache] / docs / manual / mod / mod_imagemap.html.en
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 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>mod_imagemap - Apache HTTP Server Version 2.5</title>
11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
14 <script src="../style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
18 <body>
19 <div id="page-header">
20 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
21 <p class="apache">Apache HTTP Server Version 2.5</p>
22 <img alt="" src="../images/feather.png" /></div>
23 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
24 <div id="path">
25 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
26 <div id="page-content">
27 <div id="preamble"><h1>Apache Module mod_imagemap</h1>
28 <div class="toplang">
29 <p><span>Available Languages: </span><a href="../en/mod/mod_imagemap.html" title="English">&nbsp;en&nbsp;</a> |
30 <a href="../ko/mod/mod_imagemap.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
31 </div>
32 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Server-side imagemap processing</td></tr>
33 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
34 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>imagemap_module</td></tr>
35 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_imagemap.c</td></tr></table>
36 <h3>Summary</h3>
37
38     <p>This module processes <code>.map</code> files, thereby
39     replacing the functionality of the <code>imagemap</code> CGI
40     program. Any directory or document type configured to use the
41     handler <code>imap-file</code> (using either
42     <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code> or
43     <code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code>)
44     will be processed by this module.</p>
45
46     <p>The following directive will activate files ending with
47     <code>.map</code> as imagemap files:</p>
48
49     <pre class="prettyprint lang-config">AddHandler imap-file map</pre>
50
51
52     <p>Note that the following is still supported:</p>
53
54     <pre class="prettyprint lang-config">AddType application/x-httpd-imap map</pre>
55
56
57     <p>However, we are trying to phase out "magic MIME types" so we
58     are deprecating this method.</p>
59 </div>
60 <div id="quickview"><h3>Topics</h3>
61 <ul id="topics">
62 <li><img alt="" src="../images/down.gif" /> <a href="#features">New Features</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#imapfile">Imagemap File</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#example">Example Mapfile</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#referencing">Referencing your mapfile</a></li>
66 </ul><h3 class="directives">Directives</h3>
67 <ul id="toc">
68 <li><img alt="" src="../images/down.gif" /> <a href="#imapbase">ImapBase</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#imapdefault">ImapDefault</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#imapmenu">ImapMenu</a></li>
71 </ul>
72 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_imagemap">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_imagemap">Report a bug</a></li></ul><h3>See also</h3>
73 <ul class="seealso">
74 <li><a href="#comments_section">Comments</a></li></ul></div>
75 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
76 <div class="section">
77 <h2><a name="features" id="features">New Features</a></h2>
78
79     <p>The imagemap module adds some new features that were not
80     possible with previously distributed imagemap programs.</p>
81
82     <ul>
83       <li>URL references relative to the Referer: information.</li>
84
85       <li>Default <code>&lt;base&gt;</code> assignment through a new map
86       directive <code>base</code>.</li>
87
88       <li>No need for <code>imagemap.conf</code> file.</li>
89
90       <li>Point references.</li>
91
92       <li>Configurable generation of imagemap menus.</li>
93     </ul>
94 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
95 <div class="section">
96 <h2><a name="imapfile" id="imapfile">Imagemap File</a></h2>
97
98     <p>The lines in the imagemap files can have one of several
99     formats:</p>
100
101     <div class="example"><p><code>
102       directive value [<var>x</var>,<var>y</var> ...]<br />
103       directive value "<var>Menu text</var>" [<var>x</var>,<var>y</var>
104       ...]<br />
105       directive value <var>x</var>,<var>y</var> ... "<var>Menu text</var>"
106     </code></p></div>
107
108     <p>The directive is one of <code>base</code>,
109     <code>default</code>, <code>poly</code>, <code>circle</code>,
110     <code>rect</code>, or <code>point</code>. The value is an
111     absolute or relative URL, or one of the special values listed
112     below. The coordinates are <code><var>x</var>,<var>y</var></code>
113     pairs separated by whitespace. The quoted text is used as the text of
114     the link if a imagemap menu is generated. Lines beginning with '#' are
115     comments.</p>
116
117     <h3><a name="imapfile.directives" id="imapfile.directives">Imagemap File Directives</a></h3>
118       <p>There are six directives allowed in the imagemap file. The
119       directives can come in any order, but are processed in the
120       order they are found in the imagemap file.</p>
121
122       <dl>
123       <dt><code>base</code> Directive</dt>
124
125       <dd><p>Has the effect of <code>&lt;base href="<var>value</var>"&gt;
126       </code>. The non-absolute URLs of the map-file are taken relative
127       to this value. The <code>base</code> directive overrides
128       <code class="directive"><a href="#imapbase">ImapBase</a></code> as set in a
129       <code>.htaccess</code> file or in the server configuration files.
130       In the absence of an <code class="directive">ImapBase</code> configuration
131       directive, <code>base</code> defaults to
132       <code>http://server_name/</code>.</p>
133       <p><code>base_uri</code> is synonymous with <code>base</code>.
134       Note that a trailing slash on the URL is significant.</p></dd>
135
136       <dt><code>default</code> Directive</dt>
137
138       <dd>The action taken if the coordinates given do not fit any
139       of the <code>poly</code>, <code>circle</code> or
140       <code>rect</code> directives, and there are no
141       <code>point</code> directives. Defaults to <code>nocontent</code>
142       in the absence of an <code class="directive"><a href="#imapdefault">ImapDefault</a></code> configuration setting, causing a status
143       code of <code>204 No Content</code> to be returned. The client
144       should keep the same page displayed.</dd>
145
146       <dt><code>poly</code> Directive</dt>
147
148       <dd>Takes three to one-hundred points, and is obeyed if the
149       user selected coordinates fall within the polygon defined by
150       these points.</dd>
151
152       <dt><code>circle</code></dt>
153
154       <dd>Takes the center coordinates of a circle and a point on
155       the circle. Is obeyed if the user selected point is with the
156       circle.</dd>
157
158       <dt><code>rect</code> Directive</dt>
159
160       <dd>Takes the coordinates of two opposing corners of a
161       rectangle. Obeyed if the point selected is within this
162       rectangle.</dd>
163
164       <dt><code>point</code> Directive</dt>
165
166       <dd>Takes a single point. The point directive closest to the
167       user selected point is obeyed if no other directives are
168       satisfied. Note that <code>default</code> will not be
169       followed if a <code>point</code> directive is present and
170       valid coordinates are given.</dd>
171       </dl>
172     
173
174     <h3><a name="imapfile.values" id="imapfile.values">Values</a></h3>
175
176       <p>The values for each of the directives can be any of the
177       following:</p>
178
179       <dl>
180       <dt>a URL</dt>
181
182       <dd><p>The URL can be relative or absolute URL. Relative URLs
183       can contain '..' syntax and will be resolved relative to the
184       <code>base</code> value.</p>
185       <p><code>base</code> itself will not be resolved according to the
186       current value. A statement <code>base mailto:</code> will
187       work properly, though.</p></dd>
188
189       <dt><code>map</code></dt>
190
191       <dd>Equivalent to the URL of the imagemap file itself. No
192       coordinates are sent with this, so a menu will be generated
193       unless <code class="directive"><a href="#imapmenu">ImapMenu</a></code> is set to
194       <code>none</code>.</dd>
195
196       <dt><code>menu</code></dt>
197       <dd>Synonymous with <code>map</code>.</dd>
198
199       <dt><code>referer</code></dt>
200
201       <dd>Equivalent to the URL of the referring document. Defaults
202       to <code>http://servername/</code> if no <code>Referer:</code>
203       header was present.</dd>
204
205       <dt><code>nocontent</code></dt>
206
207       <dd>Sends a status code of <code>204 No Content</code>,
208       telling the client to keep the same page displayed. Valid for
209       all but <code>base</code>.</dd>
210
211       <dt><code>error</code></dt>
212
213       <dd>Fails with a <code>500 Server Error</code>. Valid for all
214       but <code>base</code>, but sort of silly for anything but
215       <code>default</code>.</dd>
216       </dl>
217     
218
219     <h3><a name="imapfile.coords" id="imapfile.coords">Coordinates</a></h3>
220
221       <dl>
222       <dt><code>0,0 200,200</code></dt>
223
224       <dd>A coordinate consists of an <var>x</var> and a <var>y</var>
225       value separated by a comma. The coordinates are separated
226       from each other by whitespace. To accommodate the way Lynx
227       handles imagemaps, should a user select the coordinate
228       <code>0,0</code>, it is as if no coordinate had been
229       selected.</dd>
230       </dl>
231
232     
233
234     <h3><a name="imapfile.quotedtext" id="imapfile.quotedtext">Quoted Text</a></h3>
235
236       <dl>
237       <dt><code>"<var>Menu Text</var>"</code></dt>
238
239       <dd><p>After the value or after the coordinates, the line
240       optionally may contain text within double quotes. This string
241       is used as the text for the link if a menu is
242       generated:</p>
243
244       <div class="example"><p><code>
245         &lt;a href="http://example.com/"&gt;<var>Menu text</var>&lt;/a&gt;
246       </code></p></div>
247
248       <p>If no quoted text is present, the name of the link will be
249       used as the text:</p>
250
251       <div class="example"><p><code>
252         &lt;a href="http://example.com/"&gt;http://example.com&lt;/a&gt;
253       </code></p></div>
254
255       <p>If you want to use double quotes within this text, you have to
256       write them as <code>&amp;quot;</code>.</p></dd>
257       </dl>
258
259     
260 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
261 <div class="section">
262 <h2><a name="example" id="example">Example Mapfile</a></h2>
263
264     <div class="example"><p><code>
265       #Comments are printed in a 'formatted' or 'semiformatted' menu.<br />
266       #And can contain html tags. &lt;hr&gt;<br />
267       base referer<br />
268       poly map "Could I have a menu, please?" 0,0 0,10 10,10 10,0<br />
269       rect .. 0,0 77,27 "the directory of the referer"<br />
270       circle http://www.inetnebr.example.com/lincoln/feedback/ 195,0 305,27<br />
271       rect another_file "in same directory as referer" 306,0 419,27<br />
272       point http://www.zyzzyva.example.com/ 100,100<br />
273       point http://www.tripod.example.com/ 200,200<br />
274       rect mailto:nate@tripod.example.com 100,150 200,0 "Bugs?"<br />
275     </code></p></div>
276
277 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
278 <div class="section">
279 <h2><a name="referencing" id="referencing">Referencing your mapfile</a></h2>
280
281     <div class="example"><h3>HTML example</h3><p><code>
282       &lt;a href="/maps/imagemap1.map"&gt;<br />
283       <span class="indent">
284         &lt;img ismap src="/images/imagemap1.gif"&gt;<br />
285       </span>
286       &lt;/a&gt;
287     </code></p></div>
288
289     <div class="example"><h3>XHTML example</h3><p><code>
290       &lt;a href="/maps/imagemap1.map"&gt;<br />
291       <span class="indent">
292         &lt;img ismap="ismap" src="/images/imagemap1.gif" /&gt;<br />
293       </span>
294       &lt;/a&gt;
295     </code></p></div>
296
297 </div>
298 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
299 <div class="directive-section"><h2><a name="ImapBase" id="ImapBase">ImapBase</a> <a name="imapbase" id="imapbase">Directive</a></h2>
300 <table class="directive">
301 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default <code>base</code> for imagemap files</td></tr>
302 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ImapBase map|referer|<var>URL</var></code></td></tr>
303 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ImapBase http://servername/</code></td></tr>
304 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
305 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
306 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
307 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_imagemap</td></tr>
308 </table>
309     <p>The <code class="directive">ImapBase</code> directive sets the default
310     <code>base</code> used in the imagemap files. Its value is
311     overridden by a <code>base</code> directive within the imagemap
312     file. If not present, the <code>base</code> defaults to
313     <code>http://<var>servername</var>/</code>.</p>
314
315 <h3>See also</h3>
316 <ul>
317 <li><code class="directive"><a href="../mod/core.html#usecanonicalname">UseCanonicalName</a></code></li>
318 </ul>
319 </div>
320 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
321 <div class="directive-section"><h2><a name="ImapDefault" id="ImapDefault">ImapDefault</a> <a name="imapdefault" id="imapdefault">Directive</a></h2>
322 <table class="directive">
323 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default action when an imagemap is called with coordinates
324 that are not explicitly mapped</td></tr>
325 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ImapDefault error|nocontent|map|referer|<var>URL</var></code></td></tr>
326 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ImapDefault nocontent</code></td></tr>
327 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
328 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
329 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
330 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_imagemap</td></tr>
331 </table>
332     <p>The <code class="directive">ImapDefault</code> directive sets the default
333     <code>default</code> used in the imagemap files. Its value is
334     overridden by a <code>default</code> directive within the
335     imagemap file. If not present, the <code>default</code> action
336     is <code>nocontent</code>, which means that a <code>204 No
337     Content</code> is sent to the client. In this case, the client
338     should continue to display the original page.</p>
339
340 </div>
341 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
342 <div class="directive-section"><h2><a name="ImapMenu" id="ImapMenu">ImapMenu</a> <a name="imapmenu" id="imapmenu">Directive</a></h2>
343 <table class="directive">
344 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Action if no coordinates are given when calling
345 an imagemap</td></tr>
346 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ImapMenu none|formatted|semiformatted|unformatted</code></td></tr>
347 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ImapMenu formatted</code></td></tr>
348 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
349 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
350 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
351 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_imagemap</td></tr>
352 </table>
353     <p>The <code class="directive">ImapMenu</code> directive determines the
354     action taken if an imagemap file is called without valid
355     coordinates.</p>
356
357     <dl>
358       <dt><code>none</code></dt>
359       <dd>If ImapMenu is <code>none</code>, no menu is generated,
360       and the <code>default</code> action is performed.</dd>
361
362       <dt><code>formatted</code></dt>
363       <dd>A <code>formatted</code> menu is the simplest menu.
364       Comments in the imagemap file are ignored. A level one header
365       is printed, then an hrule, then the links each on a separate
366       line. The menu has a consistent, plain look close to that of
367       a directory listing.</dd>
368
369       <dt><code>semiformatted</code></dt>
370       <dd>In the <code>semiformatted</code> menu, comments are
371       printed where they occur in the imagemap file. Blank lines
372       are turned into HTML breaks. No header or hrule is printed,
373       but otherwise the menu is the same as a
374       <code>formatted</code> menu.</dd>
375
376       <dt><code>unformatted</code></dt>
377       <dd>Comments are printed, blank lines are ignored. Nothing is
378       printed that does not appear in the imagemap file. All breaks
379       and headers must be included as comments in the imagemap
380       file. This gives you the most flexibility over the appearance
381       of your menus, but requires you to treat your map files as
382       HTML instead of plaintext.</dd>
383     </dl>
384
385 </div>
386 </div>
387 <div class="bottomlang">
388 <p><span>Available Languages: </span><a href="../en/mod/mod_imagemap.html" title="English">&nbsp;en&nbsp;</a> |
389 <a href="../ko/mod/mod_imagemap.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
390 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
391 <script type="text/javascript"><!--//--><![CDATA[//><!--
392 var comments_shortname = 'httpd';
393 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_imagemap.html';
394 (function(w, d) {
395     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
396         d.write('<div id="comments_thread"><\/div>');
397         var s = d.createElement('script');
398         s.type = 'text/javascript';
399         s.async = true;
400         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
401         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
402     }
403     else {
404         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
405     }
406 })(window, document);
407 //--><!]]></script></div><div id="footer">
408 <p class="apache">Copyright 2016 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>
409 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
410 if (typeof(prettyPrint) !== 'undefined') {
411     prettyPrint();
412 }
413 //--><!]]></script>
414 </body></html>