• Aucun résultat trouvé

mod_imap

Dans le document Apache Server2 Apache Server2 (Page 183-186)

The mod_imapmodule is compiled in Apache by default. It provides image map support, which had been provided by the CGI program imagemap. You can use the AddHandlerdirective to specify the imap-filehandler (built into this module) for any file extension. For example, the following directive makes Apache treat all files with the .mapextension as image maps, and Apache processes the files by using the mod_imapmodule:

AddHandler imap-file map

The mod-imapmodule still supports the older format:

AddType application/x-httpd-imap map

However, the older format is not recommended because support for it may be dropped in the future.

The contents of an image map file can have any of the following syntax:

directive value [x,y ...]

directive value “Menu text” [x,y ...]

directive value x,y ... “Menu text”

The allowed directives in a image map file are:

base— Relative URLs used in map files are considered relative to the value of this directive. Note that the Imapbasedirective setting is overridden by this directive when found in a map file. It defaults to http://server_name/.

base_uri, which is synonymous with base. Note

default— Specifies the action to take when the coordinates do not fit into any poly, circle, or rect, and no pointdirectives are given. The default value for this directive is nocontent, which tells the client to keep the same page displayed.

poly— Defines a polygon using at least 3 points to a maximum of 100 points.

If user-supplied coordinates fall within the polygon, this directive is activated.

circle— Defines a circle using the center coordinates and a point on the cir-cle. If user-supplied coordinates fall within the circle, this directive is activated.

rect— Defines a rectangle using two opposing corner coordinates. If user-supplied coordinates fall within the rectangle, this directive is activated.

point— Defines a single point coordinate. The pointdirective closest to the user-supplied coordinate is used when no other directives are satisfied.

The value is an absolute or relative URL, or one of the special values in the following list. The coordinates (x,y) are separated by whitespace characters. The double-quoted text (shown in the second syntax) is used as the text of the link if an image map menu is generated. Any line with a leading #character is considered a com-ment and is ignored by Apache.

The coordinates are written in x,y format, in which each coordinate is separated by a whitespace character. The quoted text string is used as the link when a menu is generated. In the absence of such a string, the URL is the link, as shown in the following image map file:

# Comments go here

# Version 1.0.0

base http://www.yoursite.com/some/dir

rect thisfile.html “Customer info” 0,0 100,200

circle http://download.yoursite.com/index.html 295,0 100,22

If this image map file is called imagemap.map, it can be referenced as follows from another HTML file, such as:

<A HREF=”/path/to/imagemap.map”><IMG ISMAP SRC=”/path/to/imagemap.gif”></A>

ImapMenu

The ImapMenudirective determines the action for a request for an image map file without any valid coordinates.

Syntax:ImapMenu {None, Formatted, Semi-formatted, Unformatted}

Context:Server config, virtual host, directory, per-directory access control file (.htaccess)

Override:Indexes

ImapMenuallows the following actions:

Action What It Does

None No menu is generated, and the default action is performed.

Formatted The simplest menu is generated. Comments are ignored. A level one header is printed, and then a horizontal rule, and then the links — each on a separate line.

Semi-formatted In the semi-formatted menu, comments are printed, blank lines are converted into HTML breaks, and no header or horizontal rule is printed.

Unformatted In the unformatted menu, comments are printed, and blank lines are ignored.

ImapDefault

The ImapDefaultdirective defines the default action for image maps. This default setting can be overridden in the image map file using the default directive.

Syntax:ImapDefault {Error, Nocontent, Map, Referer, URL}

Context:Server config, virtual host, directory, per-directory access control file (.htaccess)

Override:Indexes

The following table shows the meaning of each of the possible values for ImapDefault directive.

Value What It Does

URL A relative or absolute URL. Relative URLs resolve relative to the base.

Map Same as the URL of the image map file itself. Unless ImapMenuis set to none, a menu will be created.

Menu Same as Map.

Referer Same as the URL of the referring document. Defaults to http://

servername/if no Referer:header is present.

Nocontent A status code of 204 is sent to tell the client to keep the same page displayed. This is not valid for base.

Error A status code of 500 is sent to inform the client about a server error.

ImapBase

The ImapBasedirective sets the default base used in the image map files. This base setting can be overridden by using the basedirective within the image map file. If this directive is not present, the basedefaults to http://servername/.

Syntax:ImapBase {Map, Referer, URL}

Context:Server config, virtual host, directory, per-directory access control file (.htaccess)

Override:Indexes

Dans le document Apache Server2 Apache Server2 (Page 183-186)