1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6<html xmlns="http://www.w3.org/1999/xhtml">
7  <head>
8    <meta name="generator" content="HTML Tidy, see www.w3.org" />
9
10    <title>Module mod_actions</title>
11  </head>
12  <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
13
14  <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
15  vlink="#000080" alink="#FF0000">
16        <div align="CENTER">
17      <img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]" />
18
19      <h3>Apache HTTP Server Version 1.3</h3>
20    </div>
21
22
23    <h1 align="CENTER">Module mod_actions</h1>
24
25    <p>This module provides for executing CGI scripts based on
26    media type or request method.</p>
27
28    <p><a href="module-dict.html#Status"
29    rel="Help"><strong>Status:</strong></a> Base<br />
30     <a href="module-dict.html#SourceFile"
31    rel="Help"><strong>Source File:</strong></a>
32    mod_actions.c<br />
33     <a href="module-dict.html#ModuleIdentifier"
34    rel="Help"><strong>Module Identifier:</strong></a>
35    action_module<br />
36     <a href="module-dict.html#Compatibility"
37    rel="Help"><strong>Compatibility:</strong></a> Available in
38    Apache 1.1 and later.</p>
39
40    <h2>Summary</h2>
41
42    <p>This module has two directives. The Action directive lets
43    you run CGI scripts whenever a file of a certain type is
44    requested. The Script directive lets you run CGI scripts
45    whenever a particular method is used in a request. This makes
46    it much easier to execute scripts that process files.</p>
47
48    <h2>Directives</h2>
49
50    <ul>
51      <li><a href="#action">Action</a></li>
52
53      <li><a href="#script">Script</a></li>
54    </ul>
55    <hr />
56
57    <h2><a id="action" name="action">Action directive</a></h2>
58
59    <p><a href="directive-dict.html#Syntax"
60    rel="Help"><strong>Syntax:</strong></a> Action <em>action-type
61    cgi-script</em><br />
62     <a href="directive-dict.html#Context"
63    rel="Help"><strong>Context:</strong></a> server config, virtual
64    host, directory, .htaccess<br />
65     <a href="directive-dict.html#Override"
66    rel="Help"><strong>Override:</strong></a> FileInfo<br />
67     <a href="directive-dict.html#Status"
68    rel="Help"><strong>Status:</strong></a> Base<br />
69     <a href="directive-dict.html#Module"
70    rel="Help"><strong>Module:</strong></a> mod_actions<br />
71     <a href="directive-dict.html#Compatibility"
72    rel="Help"><strong>Compatibility:</strong></a> Action is only
73    available in Apache 1.1 and later</p>
74
75    <p>This directive adds an action, which will activate
76    <em>cgi-script</em> when <em>action-type</em> is triggered by the
77    request.  The <i>cgi-script</i> is the URL-path to a resource that
78    has been configured as a CGI script using <code>ScriptAlias</code>
79    or <code>AddHandler</code>. The <em>action-type</em> can be either
80    a <a href="../handler.html">handler</a> or a MIME content type. It
81    sends the URL and file path of the requested document using the
82    standard CGI PATH_INFO and PATH_TRANSLATED environment
83    variables.</p>
84
85    <p>Examples:</p>
86    <pre>
87    # Requests for files of a particular type:
88    Action image/gif /cgi-bin/images.cgi
89
90    # Files of a particular file extension
91    AddHandler my-file-type .xyz
92    Action my-file-type /cgi-bin/program.cgi
93    </pre>
94
95    <p>In the first example, requests for files with a MIME content
96    type of <code>image/gif</code> will instead be handled by the
97    specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
98
99    <p>In the second example, requests for files with a file extension of
100    <code>.xyz</code> are handled instead by the specified cgi script
101    <code>/cgi-bin/program.cgi</code>.</p>
102
103    <p><strong>See also</strong>: <a
104        href="mod_mime.html#addhandler">AddHandler</a></p>
105
106    <hr />
107
108    <h2><a id="script" name="script">Script directive</a></h2>
109
110    <p><a href="directive-dict.html#Syntax"
111    rel="Help"><strong>Syntax:</strong></a> Script <em>method
112    cgi-script</em><br />
113     <a href="directive-dict.html#Context"
114    rel="Help"><strong>Context:</strong></a> server config, virtual
115    host, directory<br />
116     <a href="directive-dict.html#Status"
117    rel="Help"><strong>Status:</strong></a> Base<br />
118     <a href="directive-dict.html#Module"
119    rel="Help"><strong>Module:</strong></a> mod_actions<br />
120     <a href="directive-dict.html#Compatibility"
121    rel="Help"><strong>Compatibility:</strong></a> Script is only
122    available in Apache 1.1 and later; arbitrary method use is only
123    available with 1.3.10 and later</p>
124
125    <p>This directive adds an action, which will activate
126    <i>cgi-script</i> when a file is requested using the method of
127    <i>method</i>. The <i>cgi-script</i> is the URL-path to a resource
128    that has been configured as a CGI script using
129    <code>ScriptAlias</code> or <code>AddHandler</code>.  The URL and
130    file path of the requested document is sent using the standard CGI
131    PATH_INFO and PATH_TRANSLATED environment variables.</p>
132
133    <blockquote>
134      Prior to Apache 1.3.10, <i>method</i> can only be one of
135      <code>GET</code>, <code>POST</code>, <code>PUT</code>, or
136      <code>DELETE</code>. As of 1.3.10, any arbitrary method name
137      may be used. <b>Method names are case-sensitive</b>, so
138      <code>Script&nbsp;PUT</code> and <code>Script&nbsp;put</code>
139      have two entirely different effects.
140    </blockquote>
141
142    <p>Note that the Script command defines default actions only.
143    If a CGI script is called, or some other resource that is
144    capable of handling the requested method internally, it will do
145    so. Also note that Script with a method of <code>GET</code>
146    will only be called if there are query arguments present
147    (<em>e.g.</em>, foo.html?hi). Otherwise, the request will
148    proceed normally.</p>
149
150    <p>Examples:</p>
151<pre>
152    # For &lt;ISINDEX&gt;-style searching
153    Script GET /cgi-bin/search
154    # A CGI PUT handler
155    Script PUT /~bob/put.cgi
156</pre>
157        <hr />
158
159    <h3 align="CENTER">Apache HTTP Server Version 1.3</h3>
160    <a href="./"><img src="../images/index.gif" alt="Index" /></a>
161    <a href="../"><img src="../images/home.gif" alt="Home" /></a>
162
163  </body>
164</html>
165
166
167
168