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