htimageprogram in the distribution, which is an
/htbinprogram handling clicks on sensitive images. For versions 2.15 and newer it is a CGI program (uses the Common Gateway Interface to communicate with
httpd). See demo.
htimageyou should move the executable binary to the same directory as your other server scripts are, and remember to set up an exec rule. For example if your scripts are in
/usr/etc/cgi-bin, you could have an
Execrule like this:
Exec /htbin/* /usr/etc/cgi-bin/*Often
htimageis one of the most often used scripts, and it would therefore be nice to refer to it with as short a name as possible, like
/img, so you could have a
Maprule just before the
Map /img/* /htbin/htimage/* Exec /htbin/* /usr/etc/cgi-bin/*
ISMAPin your inlined image call, and
HREFto the script handling the request
(htimage)with image configuration file name appended to it.
htimagevia an image configuration file. These files are referred to by the extra path information in the URL causing the call to
<A HREF="/htbin/htimage/image/config/file"> <IMG SRC="Image.gif" ISMAP></A>Image configuration file can be:
htimagewill look for both of these (afterall, it gets both
PATH_TRANSLATEDenvironment variables from
You can even do some very smart mappings in the rule file to allow
very short references to
htimage and picture
configuration files. Let's suppose all your image configuration files
are in directory
/usr/etc/images. Then you can use the
following two rules in your server's configuration file (by default
Map /img/* /htbin/htimage/usr/etc/images/* Exec /htbin/* /usr/etc/cgi-bin/*In this case you can refer to your image mapper very easily; if you have an image configuration file
/usr/etc/imagesdirectory, all you need to say in the anchor is this:
<A HREF="/img/Dragons.conf"> <IMG SRC="Image.gif" ISMAP></A>
circle(x,y) r URL
rectangle(x1,y1) (x2,y2) URL
polygon(x1,y1) (x2,y2) ... (xn,yn) URL
htimage.So first point is added also as the last one if necessary.
def, circ, rect, poly.
Shapes are checked in the order they appear in config file, and the
URL corresponding to the first match is returned. If none match, the
default URL is returned.
htimageprints a single
Location:field to its
stdout, or an error message with preceding
Content-Type: text/htmlso in fact
htimagebehaves exactly as any other CGI/1.0 program (script), and is not in any way handled specially by the server. Therefore, you can rename
htimageto whatever you prefer, like we called it
/imgin the above example.
Server understands this
Location: field, and either
directly sends that file to the client (non-full URL), or sends a
redirection to client causing it to fetch the document, maybe even
from another machine.
Note that URLs returned by
htimage may well be other
script requests - there is no reason for being limited to just regular