4.8. HandlersA handler is a piece of code built into Apache that performs certain actions when a file with a particular MIME or handler type is called. For example, a file with the handler type cgi-script needs to be executed as a CGI script. This is illustrated in ... /site.filter. Apache has a number of handlers built in, and others can be added with the Actions command (see the next section). The built-in handlers are as follows:
The corresponding directives follow. 4.8.1. AddHandlerAddHandler handler-name extension1 extension2 ... Server config, virtual host, directory, .htaccess AddHandler wakes up an existing handler and maps the filename(s) extension1, etc., to handler-name. You might specify the following in your Config file: AddHandler cgi-script cgi bzq From then on, any file with the extension .cgi or .bzq would be treated as an executable CGI script. 4.8.2. SetHandlerSetHandler handler-name Directory, .htaccess This does the same thing as AddHandler, but applies the transformation specified by handler-name to all files in the <Directory>, <Location>, or <Files> section in which it is placed, or in the .htaccess directory. For instance, in Chapter 11, "What's Going On?", we write: <Location /status> <Limit get> order deny, allow allow from 192.168.123.1 deny from all </Limit> SetHandler server-status </Location> Copyright © 2001 O'Reilly & Associates. All rights reserved. |
|