Apache The Definitive Guide, 3rd EditionApache: The Definitive GuideSearch this book

7.4. Image Map Directives

The three image map directives let you specify how Apache handles serverside image maps.

ImapBase

ImapBase [map|referer|URL]
Default: http://servername
Server config, virtual host, directory, .htaccess 

This directive sets the base URL for the ImageMap, as follows:

map
The URL of the ImageMap itself.

referer
The URL of the referring document. If this is unknown, http://servername/ is used.

URL
The specified URL.

If this directive is absent, the map base defaults to http://servername/, which is the same as the DocumentRoot directory.

ImapMenu


ImapMenu [none|formatted|semiformatted|unformatted]
Server config, virtual host, directory, .htaccess
Default: formatted

This directive applies if mapping fails or if the browser is incapable of displaying images. If the site is accessed using a text-based browser such as Lynx, a menu is displayed showing the possibilities in the .map file:

MENU FOR /BENCH.MAP
--------------------------------------
       things
       right.html

This is formatted according to the argument given to ImapMenu. The previous effect is produced by formatted. The manual explains the options as follows:

formatted
A formatted menu is the simplest menu. Comments in the ImageMap file are ignored. A level-one header is printed, then a horizontal rule, and then the links, each on a separate line. The menu has a consistent, plain look close to that of a directory listing.

semiformatted
In the semiformatted menu, comments are printed where they occur in the ImageMap file. Blank lines are turned into HTML breaks. No header or horizontal rule is printed, but otherwise the menu is the same as a formatted menu.

unformatted
Comments are printed; blank lines are ignored. Nothing is printed that does not appear in the ImageMap file. All breaks and headers must be included as comments in the ImageMap file. This gives you the most flexibility over the appearance of your menus, but requires you to treat your map files as HTML instead of plain text.

The argument none redisplays the document sides.html.

ImapDefault

ImapDefault [error|nocontent|map|URL]
Default: nocontent
Server config, virtual host, directory, .htaccess 

There is a choice of actions (if you spell them incorrectly, no error message appears and no action results):

error
This makes Apache serve up a standard error message, which appears on the browser (depending on which one it is) as something like "Internal Server Error."

nocontent
Apache ignores the request.

map
Apache returns the message Document moved here.

URL
Apache returns the URL. If it is relative, then it will be relative to the ImageMap base. On this site we serve up the file default.html to deal with errors. It contains the message:

You're clicking in the wrong place


Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.