<modulesynopsis metafile="mod_actions.xml.meta">
-<name>mod_actions</name>
+<name>mod_actions</name>
-<description>This module provides for executing CGI scripts based on
-media type or request method.</description>
+<description>Execute CGI scripts based on media type or request method.</description>
<status>Base</status>
<sourcefile>mod_actions.c</sourcefile>
<seealso><module>mod_cgi</module></seealso>
<seealso><a href="../howto/cgi.html">Dynamic Content with CGI</a></seealso>
-<seealso><a href="../handler.html">Apache's Handler Use</a></seealso>
+<seealso><a href="../handler.html">Apache httpd's Handler Use</a></seealso>
<directivesynopsis>
<name>Action</name>
<context>directory</context><context>.htaccess</context>
</contextlist>
<override>FileInfo</override>
-<compatibility>The <code>virtual</code> modifier and handler passing were
-introduced in Apache 2.1</compatibility>
<usage>
<p>This directive adds an action, which will activate
is passed using the <code>REDIRECT_HANDLER</code> variable.</p>
<example><title>Example: MIME type</title>
- # Requests for files of a particular MIME content type:<br />
- Action image/gif /cgi-bin/images.cgi<br />
- <br />
+ <highlight language="config">
+# Requests for files of a particular MIME content type:
+Action image/gif /cgi-bin/images.cgi
+ </highlight>
</example>
<p>In this example, requests for files with a MIME content
type of <code>image/gif</code> will be handled by the
specified cgi script <code>/cgi-bin/images.cgi</code>.</p>
- <example><title>Example: File extension</title>
- # Files of a particular file extension<br />
- AddHandler my-file-type .xyz<br />
- Action my-file-type /cgi-bin/program.cgi<br />
+ <example>
+ <title>Example: File extension</title>
+ <highlight language="config">
+# Files of a particular file extension
+AddHandler my-file-type .xyz
+Action my-file-type /cgi-bin/program.cgi
+ </highlight>
</example>
-
<p>In this example, requests for files with a file extension of
- <code>.xyz</code> are handled by the specified cgi script
+ <code>.xyz</code> are handled by the specified cgi script
<code>/cgi-bin/program.cgi</code>.</p>
<p>The optional <code>virtual</code> modifier turns off the check
if you want to use the <directive>Action</directive> directive in
virtual locations.</p>
- <example><title>Example</title>
- <Location /news><br />
- <indent>
- SetHandler news-handler<br />
- Action news-handler /cgi-bin/news.cgi virtual<br />
- </indent>
- </Location>
- </example>
+ <highlight language="config">
+<Location "/news">
+ SetHandler news-handler
+ Action news-handler /cgi-bin/news.cgi virtual
+</Location>
+ </highlight>
</usage>
<seealso><directive module="mod_mime">AddHandler</directive></seealso>
module="mod_alias">ScriptAlias</directive> or <directive
module="mod_mime">AddHandler</directive>. The URL and
file path of the requested document is sent using the standard CGI
- <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment
+ <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment
variables.</p>
<note>
effects.
</note>
- <p>Note that the <directive>Script</directive> command defines default
+ <p>Note that the <directive>Script</directive> command defines default
actions only. If a CGI script is called, or some other resource that is
capable of handling the requested method internally, it will do
- so. Also note that <directive>Script</directive> with a method of
+ so. Also note that <directive>Script</directive> with a method of
<code>GET</code> will only be called if there are query arguments present
(<em>e.g.</em>, foo.html?hi). Otherwise, the request will
proceed normally.</p>
- <example><title>Examples</title>
- # For <ISINDEX>-style searching<br />
- Script GET /cgi-bin/search<br />
- <br />
- # A CGI PUT handler<br />
- Script PUT /~bob/put.cgi<br />
- </example>
+ <highlight language="config">
+# All GET requests go here
+Script GET /cgi-bin/search
+
+# A CGI PUT handler
+Script PUT /~bob/put.cgi
+ </highlight>
</usage>
</directivesynopsis>