2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
6 <name>mod_actions</name>
8 <description>This module provides for executing CGI scripts based on
9 media type or request method.</description>
12 <sourcefile>mod_actions.c</sourcefile>
13 <identifier>actions_module</identifier>
16 <p>This module has two directives. The <directive
17 module="mod_actions">Action</directive> directive lets you run CGI
18 scripts whenever a file of a certain type is requested. The
19 <directive module="mod_actions">Script</directive> directive lets
20 you run CGI scripts whenever a particular method is used in a
21 request. This makes it much easier to execute scripts that process
29 <description>Activates a CGI script for a particular handler or
30 content-type</description>
32 <syntax>Action <em>action-type cgi-script</em></syntax>
34 <context>server config</context><context>virtual host</context>
35 <context>directory</context><context>.htaccess</context>
37 <override>FileInfo</override>
40 <p>This directive adds an action, which will activate
41 <em>cgi-script</em> when <em>action-type</em> is triggered by the
42 request. The <em>cgi-script</em> is the URL-path to a resource
43 that has been designated as a CGI script using <directive
44 module="mod_alias">ScriptAliase</directive> or <directive
45 module="mod_mime">AddHandler</directive>. The
46 <em>action-type</em> can be either a <a
47 href="../handler.html">handler</a> or a MIME content type. It
48 sends the URL and file path of the requested document using the
49 standard CGI PATH_INFO and PATH_TRANSLATED environment
53 <title>Examples</title>
55 # Requests for files of a particular type:<br />
56 Action image/gif /cgi-bin/images.cgi<br />
58 # Files of a particular file extension<br />
59 AddHandler my-file-type .xyz<br />
60 Action my-file-type /cgi-bin/program.cgi<br />
63 <p>In the first example, requests for files with a MIME content
64 type of <code>image/gif</code> will instead be handled by the
65 specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
67 <p>In the second example, requests for files with a file extension of
68 <code>.xyz</code> are handled instead by the specified cgi script
69 <code>/cgi-bin/program.cgi</code>.</p>
72 <seealso><directive module="mod_mime">AddHandler</directive></seealso>
80 <description>Activates a CGI script for a particular request
82 <syntax> Script <em>method cgi-script</em></syntax>
84 <context>server config</context><context>virtual host</context>
85 <context>directory</context></contextlist>
87 <p>This directive adds an action, which will activate
88 <em>cgi-script</em> when a file is requested using the method of
89 <em>method</em>. The <em>cgi-script</em> is the URL-path to a
90 resource that has been designated as a CGI script using <directive
91 module="mod_alias">ScriptAliase</directive> or <directive
92 module="mod_mime">AddHandler</directive>. The URL and
93 file path of the requested document is sent using the standard CGI
94 PATH_INFO and PATH_TRANSLATED environment variables.</p>
97 Any arbitrary method name may be used. <strong>Method names are
98 case-sensitive</strong>, so <code>Script PUT</code> and
99 <code>Script put</code> have two entirely different
103 <p>Note that the Script command defines default actions only.
104 If a CGI script is called, or some other resource that is
105 capable of handling the requested method internally, it will do
106 so. Also note that Script with a method of <code>GET</code>
107 will only be called if there are query arguments present
108 (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
109 proceed normally.</p>
112 <title>Examples</title>
113 # For <ISINDEX>-style searching<br />
114 Script GET /cgi-bin/search<br />
115 # A CGI PUT handler<br />
116 Script PUT /~bob/put.cgi<br />