diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:19 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:45 +0100 |
commit | 2a463b3cd73c32ee9dcd508248d0194923f435f4 (patch) | |
tree | 2ff478255a77a55031056790918b6f983bb7b20a /docs/manual/expr.html.en | |
parent | 86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45 (diff) | |
download | apache2-upstream/2.4.9.tar.gz |
Imported Upstream version 2.4.9upstream/2.4.9
Diffstat (limited to 'docs/manual/expr.html.en')
-rw-r--r-- | docs/manual/expr.html.en | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/docs/manual/expr.html.en b/docs/manual/expr.html.en index 5c3ae459..82121a84 100644 --- a/docs/manual/expr.html.en +++ b/docs/manual/expr.html.en @@ -9,7 +9,7 @@ <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <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" /> -<script src="./style/scripts/prettify.js" type="text/javascript"> +<script src="./style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="./images/favicon.ico" rel="shortcut icon" /></head> @@ -25,17 +25,15 @@ <a href="./fr/expr.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p> </div> - <p>Historically, there are several syntax variants for expressions used to express - a condition in the different modules of the Apache HTTP Server. - There is some ongoing effort to only use a single variant, called <em>ap_expr</em>, - for all configuration directives. - This document describes the <em>ap_expr</em> expression parser. + <p>Historically, there are several syntax variants for expressions + used to express a condition in the different modules of the Apache + HTTP Server. There is some ongoing effort to only use a single + variant, called <em>ap_expr</em>, for all configuration directives. + This document describes the <em>ap_expr</em> expression parser. </p> <p>The <em>ap_expr</em> expression is intended to replace most other - expression variants in HTTPD. For example, the deprecated - <code class="directive"><a href="./mod/mod_ssl.html#sslrequire">SSLRequire</a></code> expressions can be - replaced by <a href="mod/mod_authz_core.html#reqexpr">Require expr</a>. - </p> + expression variants in HTTPD. For example, the deprecated <code class="directive"><a href="./mod/mod_ssl.html#sslrequire">SSLRequire</a></code> expressions can be replaced + by <a href="mod/mod_authz_core.html#reqexpr">Require expr</a>. </p> </div> <div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#grammar">Grammar in Backus-Naur Form notation</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#vars">Variables</a></li> @@ -46,21 +44,22 @@ <li><img alt="" src="./images/down.gif" /> <a href="#other">Other</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#sslrequire">Comparison with SSLRequire</a></li> <li><img alt="" src="./images/down.gif" /> <a href="#compatibility">Version History</a></li> -</ul><h3>See also</h3><ul class="seealso"><li><code class="directive"><a href="./mod/core.html#if"><If></a></code></li><li><code class="directive"><a href="./mod/core.html#elseif"><ElseIf></a></code></li><li><code class="directive"><a href="./mod/core.html#else"><Else></a></code></li><li><code class="directive"><a href="./mod/mod_auth_basic.html#authbasicfake">AuthBasicFake</a></code></li><li><code class="directive"><a href="./mod/mod_auth_form.html#authformloginrequiredlocation">AuthFormLoginRequiredLocation</a></code></li><li><code class="directive"><a href="./mod/mod_auth_form.html#authformloginsuccesslocation">AuthFormLoginSuccessLocation</a></code></li><li><code class="directive"><a href="./mod/mod_auth_form.html#authformlogoutlocation">AuthFormLogoutLocation</a></code></li><li><code class="directive"><a href="./mod/mod_rewrite.html#rewritecond">RewriteCond</a></code></li><li><code class="directive"><a href="./mod/mod_setenvif.html#setenvifexpr">SetEnvIfExpr</a></code></li><li><code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code></li><li><code class="directive"><a href="./mod/mod_headers.html#requestheader">RequestHeader</a></code></li><li><code class="directive"><a href="./mod/mod_filter.html#filterprovider">FilterProvider</a></code></li><li><a href="mod/mod_authz_core.html#reqexpr">Require expr</a></li><li><code class="directive"><a href="./mod/mod_ssl.html#sslrequire">SSLRequire</a></code></li><li><code class="directive"><a href="./mod/mod_log_debug.html#logmessage">LogMessage</a></code></li><li><code class="module"><a href="./mod/mod_include.html">mod_include</a></code></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> +</ul><h3>See also</h3><ul class="seealso"><li><code class="directive"><a href="./mod/core.html#if"><If></a></code></li><li><code class="directive"><a href="./mod/core.html#elseif"><ElseIf></a></code></li><li><code class="directive"><a href="./mod/core.html#else"><Else></a></code></li><li><code class="directive"><a href="./mod/mod_auth_basic.html#authbasicfake">AuthBasicFake</a></code></li><li><code class="directive"><a href="./mod/mod_auth_form.html#authformloginrequiredlocation">AuthFormLoginRequiredLocation</a></code></li><li><code class="directive"><a href="./mod/mod_auth_form.html#authformloginsuccesslocation">AuthFormLoginSuccessLocation</a></code></li><li><code class="directive"><a href="./mod/mod_auth_form.html#authformlogoutlocation">AuthFormLogoutLocation</a></code></li><li><code class="directive"><a href="./mod/mod_rewrite.html#rewritecond">RewriteCond</a></code></li><li><code class="directive"><a href="./mod/mod_setenvif.html#setenvifexpr">SetEnvIfExpr</a></code></li><li><code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code></li><li><code class="directive"><a href="./mod/mod_headers.html#requestheader">RequestHeader</a></code></li><li><code class="directive"><a href="./mod/mod_filter.html#filterprovider">FilterProvider</a></code></li><li><a href="mod/mod_authz_core.html#reqexpr">Require expr</a></li><li><a href="mod/mod_authnz_ldap.html#requser">Require ldap-user</a></li><li><a href="mod/mod_authnz_ldap.html#reqgroup">Require ldap-group</a></li><li><a href="mod/mod_authnz_ldap.html#reqdn">Require ldap-dn</a></li><li><a href="mod/mod_authnz_ldap.html#reqattribute">Require ldap-attribute</a></li><li><a href="mod/mod_authnz_ldap.html#reqfilter">Require ldap-filter</a></li><li><a href="mod/mod_authz_dbd.html#reqgroup">Require dbd-group</a></li><li><a href="mod/mod_authz_dbm.html#reqgroup">Require dbm-group</a></li><li><a href="mod/mod_authz_groupfile.html#reqgroup">Require group</a></li><li><a href="mod/mod_authz_host.html#reqhost">Require host</a></li><li><code class="directive"><a href="./mod/mod_ssl.html#sslrequire">SSLRequire</a></code></li><li><code class="directive"><a href="./mod/mod_log_debug.html#logmessage">LogMessage</a></code></li><li><code class="module"><a href="./mod/mod_include.html">mod_include</a></code></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> <h2><a name="grammar" id="grammar">Grammar in Backus-Naur Form notation</a></h2> - <p><a href="http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form">Backus-Naur Form</a> (BNF) is a notation - technique for context-free grammars, often used to describe the syntax of languages used in computing. + <p><a href="http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form">Backus-Naur + Form</a> (BNF) is a notation technique for context-free grammars, + often used to describe the syntax of languages used in computing. In most cases, expressions are used to express boolean values. - For these, the starting point in the BNF is <code>expr</code>. However, a few directives - like <code class="directive"><a href="./mod/mod_log_debug.html#logmessage">LogMessage</a></code> accept expressions - that evaluate to a string value. For those, the starting point in the BNF is <code>string</code>. + For these, the starting point in the BNF is <code>expr</code>. + However, a few directives like <code class="directive"><a href="./mod/mod_log_debug.html#logmessage">LogMessage</a></code> accept expressions + that evaluate to a string value. For those, the starting point in + the BNF is <code>string</code>. </p> <blockquote> -<pre> -expr ::= "<strong>true</strong>" | "<strong>false</strong>" +<pre>expr ::= "<strong>true</strong>" | "<strong>false</strong>" | "<strong>!</strong>" expr | expr "<strong>&&</strong>" expr | expr "<strong>||</strong>" expr @@ -119,8 +118,7 @@ rebackref ::= "<strong>$</strong>" [0-9] function ::= funcname "<strong>(</strong>" word "<strong>)</strong>" -listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" -</pre> +listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"</pre> </blockquote> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> @@ -216,8 +214,8 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" <td>The <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> of the current vhost</td></tr> <tr><td><code>AUTH_TYPE</code></td> - <td>The configured <code class="directive"><a href="./mod/mod_authn_core.html#authtype">AuthType</a></code> - (e.g. "<code>basic</code>")</td></tr> + <td>The configured <code class="directive"><a href="./mod/mod_authn_core.html#authtype">AuthType</a></code> (e.g. + "<code>basic</code>")</td></tr> <tr class="odd"><td><code>CONTENT_TYPE</code></td> <td>The content type of the response</td></tr> <tr><td><code>HANDLER</code></td> @@ -262,14 +260,16 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" <td>The day of the week (starting with <code>0</code> for Sunday)</td></tr> <tr class="odd"><td><code>TIME</code></td> - <td>The date and time in the format <code>20101231235959</code></td></tr> + <td>The date and time in the format + <code>20101231235959</code></td></tr> <tr><td><code>SERVER_SOFTWARE</code></td> <td>The server version string</td></tr> <tr class="odd"><td><code>API_VERSION</code></td> <td>The date of the API version (module magic number)</td></tr> </table> - <p>Some modules register additional variables, see e.g. <code class="module"><a href="./mod/mod_ssl.html">mod_ssl</a></code>.</p> + <p>Some modules register additional variables, see e.g. + <code class="module"><a href="./mod/mod_ssl.html">mod_ssl</a></code>.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> @@ -392,7 +392,8 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" "<code>false</code>", or "<code>no</code>" (case insensitive). True otherwise.</td><td /></tr> <tr><td><code>-R</code></td> - <td>Same as "<code>%{REMOTE_ADDR} -ipmatch ...</code>", but more efficient + <td>Same as "<code>%{REMOTE_ADDR} -ipmatch ...</code>", but more + efficient </td><td /></tr> </table> @@ -417,7 +418,9 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" <tr><td><code>resp</code></td> <td>Get HTTP response header</td><td /></tr> <tr class="odd"><td><code>reqenv</code></td> - <td>Lookup request environment variable (as a shortcut, <code>v</code> can be used too to access variables).</td><td /></tr> + <td>Lookup request environment variable (as a shortcut, + <code>v</code> can be used too to access + variables).</td><td /></tr> <tr><td><code>osenv</code></td> <td>Lookup operating system environment variable</td><td /></tr> <tr class="odd"><td><code>note</code></td> @@ -461,11 +464,11 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" the expression. The <code>req_novary</code> function can be used to prevent names from being added to the Vary header.</p> - <p>In addition to string-valued functions, there are also list-valued functions which - take one string as argument and return a wordlist, i.e. a list of strings. The wordlist - can be used with the special <code>-in</code> operator. - Functions names are not case sensitive. - Modules may register additional functions.</p> + <p>In addition to string-valued functions, there are also + list-valued functions which take one string as argument and return a + wordlist, i.e. a list of strings. The wordlist can be used with the + special <code>-in</code> operator. Functions names are not case + sensitive. Modules may register additional functions.</p> <p>There are no built-in list-valued functions. <code class="module"><a href="./mod/mod_ssl.html">mod_ssl</a></code> provides <code>PeerExtList</code>. See the description of @@ -478,10 +481,10 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" <h2><a name="examples" id="examples">Example expressions</a></h2> - <p>The following examples show how expressions might be used to evaluate requests:</p> + <p>The following examples show how expressions might be used to + evaluate requests:</p> - <pre class="prettyprint lang-config"> -# Compare the host name to example.com and redirect to www.example.com if it matches + <pre class="prettyprint lang-config"># Compare the host name to example.com and redirect to www.example.com if it matches <If "%{HTTP_HOST} == 'example.com'"> Redirect permanent / http://www.example.com/ </If> @@ -493,9 +496,8 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" # Only allow access to this content during business hours <Directory "/foo/bar/business"> - Require expr "%{TIME_HOUR} -gt 9 && %{TIME_HOUR} -lt 17" -</Directory> - </pre> + Require expr %{TIME_HOUR} -gt 9 && %{TIME_HOUR} -lt 17 +</Directory></pre> </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> <div class="section"> @@ -508,7 +510,8 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>" <td>string contained in string list</td></tr> <tr class="odd"><td><code>/regexp/</code></td> <td><code>m#regexp#</code></td> - <td>Regular expression (the second form allows different delimiters than /)</td></tr> + <td>Regular expression (the second form allows different + delimiters than /)</td></tr> <tr><td><code>/regexp/i</code></td> <td><code>m#regexp#i</code></td> <td>Case insensitive regular expression</td></tr> @@ -561,7 +564,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/expr.html'; } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 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> +<p class="apache">Copyright 2014 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> <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[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); |