github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/manual/mod/mod_actions.html.en (about) 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> 4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> 5 <!-- 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 This file is generated from xml source: DO NOT EDIT 8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 9 --> 10 <title>mod_actions - Apache HTTP Server Version 2.2</title> 11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 13 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> 14 <script src="../style/scripts/prettify.min.js" type="text/javascript"> 15 </script> 16 17 <link href="../images/favicon.ico" rel="shortcut icon" /><link href="http://httpd.apache.org/docs/current/mod/mod_actions.html" rel="canonical" /></head> 18 <body> 19 <div id="page-header"> 20 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> 21 <p class="apache">Apache HTTP Server Version 2.2</p> 22 <img alt="" src="../images/feather.gif" /></div> 23 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> 24 <div id="path"> 25 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.2</a> > <a href="./">Modules</a></div> 26 <div id="page-content"> 27 <div class="retired"><h4>Please note</h4> 28 <p> This document refers to a legacy release (<strong>2.2</strong>) of Apache httpd. The active release (<strong>2.4</strong>) is documented <a href="http://httpd.apache.org/docs/current">here</a>. If you have not already upgraded, please follow <a href="http://httpd.apache.org/docs/current/upgrading.html">this link</a> for more information.</p> 29 <p>You may follow <a href="http://httpd.apache.org/docs/current/mod/mod_actions.html">this link</a> to go to the current version of this document.</p></div><div id="preamble"><h1>Apache Module mod_actions</h1> 30 <div class="toplang"> 31 <p><span>Available Languages: </span><a href="../de/mod/mod_actions.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> | 32 <a href="../en/mod/mod_actions.html" title="English"> en </a> | 33 <a href="../ja/mod/mod_actions.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 34 <a href="../ko/mod/mod_actions.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 35 </div> 36 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>This module provides for executing CGI scripts based on 37 media type or request method.</td></tr> 38 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr> 39 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>actions_module</td></tr> 40 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_actions.c</td></tr></table> 41 <h3>Summary</h3> 42 43 <p>This module has two directives. The <code class="directive"><a href="#action">Action</a></code> directive lets you run CGI 44 scripts whenever a file of a certain <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME content type</a> is requested. The 45 <code class="directive"><a href="#script">Script</a></code> directive lets 46 you run CGI scripts whenever a particular method is used in a 47 request. This makes it much easier to execute scripts that process 48 files.</p> </div> 49 <div id="quickview"><h3 class="directives">Directives</h3> 50 <ul id="toc"> 51 <li><img alt="" src="../images/down.gif" /> <a href="#action">Action</a></li> 52 <li><img alt="" src="../images/down.gif" /> <a href="#script">Script</a></li> 53 </ul> 54 <h3>See also</h3> 55 <ul class="seealso"> 56 <li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li> 57 <li><a href="../howto/cgi.html">Dynamic Content with CGI</a></li> 58 <li><a href="../handler.html">Apache's Handler Use</a></li> 59 </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 60 61 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 62 <div class="directive-section"><h2><a name="Action" id="Action">Action</a> <a name="action" id="action">Directive</a></h2> 63 <table class="directive"> 64 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Activates a CGI script for a particular handler or 65 content-type</td></tr> 66 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Action <var>action-type</var> <var>cgi-script</var> [virtual]</code></td></tr> 67 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 68 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> 69 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 70 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_actions</td></tr> 71 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The <code>virtual</code> modifier and handler passing were 72 introduced in Apache 2.1</td></tr> 73 </table> 74 <p>This directive adds an action, which will activate 75 <var>cgi-script</var> when <var>action-type</var> is triggered by 76 the request. The <var>cgi-script</var> is the URL-path to a 77 resource that has been designated as a CGI script using <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code>. The 78 <var>action-type</var> can be either a <a href="../handler.html">handler</a> or a <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME content type</a>. It sends the URL and 79 file path of the requested document using the standard CGI 80 <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> 81 environment variables. The handler used for the particular request 82 is passed using the <code>REDIRECT_HANDLER</code> variable.</p> 83 84 <div class="example"><h3>Examples</h3><p><code> 85 # Requests for files of a particular MIME content type:<br /> 86 Action image/gif /cgi-bin/images.cgi<br /> 87 <br /> 88 # Files of a particular file extension<br /> 89 AddHandler my-file-type .xyz<br /> 90 Action my-file-type /cgi-bin/program.cgi<br /> 91 </code></p></div> 92 93 <p>In the first example, requests for files with a MIME content 94 type of <code>image/gif</code> will be handled by the 95 specified cgi script <code>/cgi-bin/images.cgi</code>.</p> 96 97 <p>In the second example, requests for files with a file extension of 98 <code>.xyz</code> are handled by the specified cgi script 99 <code>/cgi-bin/program.cgi</code>.</p> 100 101 <p>The optional <code>virtual</code> modifier turns off the check 102 whether the requested file really exists. This is useful, for example, 103 if you want to use the <code class="directive">Action</code> directive in 104 virtual locations.</p> 105 106 <div class="example"><h3>Example</h3><p><code> 107 <Location /news><br /> 108 <span class="indent"> 109 SetHandler news-handler<br /> 110 Action news-handler /cgi-bin/news.cgi virtual<br /> 111 </span> 112 </Location> 113 </code></p></div> 114 115 <h3>See also</h3> 116 <ul> 117 <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li> 118 </ul> 119 </div> 120 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 121 <div class="directive-section"><h2><a name="Script" id="Script">Script</a> <a name="script" id="script">Directive</a></h2> 122 <table class="directive"> 123 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Activates a CGI script for a particular request 124 method.</td></tr> 125 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Script <var>method</var> <var>cgi-script</var></code></td></tr> 126 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr> 127 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 128 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_actions</td></tr> 129 </table> 130 <p>This directive adds an action, which will activate 131 <var>cgi-script</var> when a file is requested using the method of 132 <var>method</var>. The <var>cgi-script</var> is the URL-path to a 133 resource that has been designated as a CGI script using <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code>. The URL and 134 file path of the requested document is sent using the standard CGI 135 <code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment 136 variables.</p> 137 138 <div class="note"> 139 Any arbitrary method name may be used. <strong>Method names are 140 case-sensitive</strong>, so <code>Script PUT</code> and 141 <code>Script put</code> have two entirely different 142 effects. 143 </div> 144 145 <p>Note that the <code class="directive">Script</code> command defines default 146 actions only. If a CGI script is called, or some other resource that is 147 capable of handling the requested method internally, it will do 148 so. Also note that <code class="directive">Script</code> with a method of 149 <code>GET</code> will only be called if there are query arguments present 150 (<em>e.g.</em>, foo.html?hi). Otherwise, the request will 151 proceed normally.</p> 152 153 <div class="example"><h3>Examples</h3><p><code> 154 # For <ISINDEX>-style searching<br /> 155 Script GET /cgi-bin/search<br /> 156 <br /> 157 # A CGI PUT handler<br /> 158 Script PUT /~bob/put.cgi<br /> 159 </code></p></div> 160 161 </div> 162 </div> 163 <div class="bottomlang"> 164 <p><span>Available Languages: </span><a href="../de/mod/mod_actions.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> | 165 <a href="../en/mod/mod_actions.html" title="English"> en </a> | 166 <a href="../ja/mod/mod_actions.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 167 <a href="../ko/mod/mod_actions.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p> 168 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 169 <script type="text/javascript"><!--//--><![CDATA[//><!-- 170 var comments_shortname = 'httpd'; 171 var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_actions.html'; 172 (function(w, d) { 173 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 174 d.write('<div id="comments_thread"><\/div>'); 175 var s = d.createElement('script'); 176 s.type = 'text/javascript'; 177 s.async = true; 178 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 179 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 180 } 181 else { 182 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 183 } 184 })(window, document); 185 //--><!]]></script></div><div id="footer"> 186 <p class="apache">Copyright 2017 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> 187 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 188 if (typeof(prettyPrint) !== 'undefined') { 189 prettyPrint(); 190 } 191 //--><!]]></script> 192 </body></html>