summaryrefslogtreecommitdiff
path: root/docs/manual/expr.html.en
diff options
context:
space:
mode:
Diffstat (limited to 'docs/manual/expr.html.en')
-rw-r--r--docs/manual/expr.html.en30
1 files changed, 29 insertions, 1 deletions
diff --git a/docs/manual/expr.html.en b/docs/manual/expr.html.en
index ee80b686..20176d7f 100644
--- a/docs/manual/expr.html.en
+++ b/docs/manual/expr.html.en
@@ -39,6 +39,7 @@
<li><img alt="" src="./images/down.gif" /> <a href="#binop">Binary operators</a></li>
<li><img alt="" src="./images/down.gif" /> <a href="#unnop">Unary operators</a></li>
<li><img alt="" src="./images/down.gif" /> <a href="#functions">Functions</a></li>
+<li><img alt="" src="./images/down.gif" /> <a href="#examples">Example expressions</a></li>
<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>
</ul><h3>See also</h3><ul class="seealso"><li><code class="directive"><a href="./mod/core.html#if">&lt;If&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#elseif">&lt;ElseIf&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#else">&lt;Else&gt;</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></div>
@@ -127,7 +128,7 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
<code>%{REMOTE_USER}</code> will not be set in this case.</p>
<p>The following variables provide the values of the named HTTP request
- headers. The values of other headers can be obtained witht the
+ headers. The values of other headers can be obtained with the
<code>req</code> <a href="#functions">function</a>.</p>
<table class="bordered"><tr class="header"><th>Name</th></tr>
@@ -440,6 +441,33 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
+<h2><a name="examples" id="examples">Example expressions</a></h2>
+
+
+ <p>The following examples show how expressions might be used to evaluate requests:</p>
+
+ <div class="example"><p><code>
+ # Compare the host name to example.com and redirect to www.example.com if it matches<br />
+ &lt;If "%{HTTP_HOST} == 'example.com'"&gt;<br />
+ <span class="indent">
+ Redirect permanent / http://www.example.com<br />
+ </span>
+ &lt;/If&gt;<br /><br />
+ # Force text/plain if requesting a file with the query string contains 'forcetext'<br />
+ &lt;If "%{QUERY_STRING} =~ /forcetext/"&gt;<br />
+ <span class="indent">
+ ForceType text/plain<br />
+ </span>
+ &lt;/If&gt;<br /><br />
+ # Only allow access to this content during business hours<br />
+ &lt;Directory "/foo/bar/business"&gt;<br />
+ <span class="indent">
+ Require expr %{TIME_HOUR} &gt;= 9 &amp;&amp; %{TIME_HOUR} &lt;= 17 <br />
+ </span>
+ &lt;/Directory&gt;
+ </code></p></div>
+</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
+<div class="section">
<h2><a name="other" id="other">Other</a></h2>