]> granicus.if.org Git - apache/commitdiff
Briefly describe <If> sections and how they are merged.
authorStefan Fritsch <sf@apache.org>
Tue, 18 Jan 2011 22:50:44 +0000 (22:50 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 18 Jan 2011 22:50:44 +0000 (22:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060606 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/sections.xml

index 344b55821c0e4f6566d4ca545b6442c29e657a9c..91e6ea9e80092ad224ee57fc6443d2b709ed9216 100644 (file)
@@ -128,7 +128,7 @@ Also, these sections can be nested to achieve more complex
 restrictions.</p>
 </section>
 
-<section id="file-and-web"><title>Filesystem and Webspace</title>
+<section id="file-and-web"><title>Filesystem, Webspace, and Boolean Expressions</title>
 
 <p>The most commonly used configuration section containers are the
 ones that change the configuration of particular places in the
@@ -304,6 +304,20 @@ Deny from all<br />
 
 </section>
 
+<section id="expressions"><title>Boolean expressions</title>
+<p>The <directive type="section" module="core">If</directive>
+directive change the configuration depending on a condition which can be
+expressed by a boolean expression. For example, the following configuration
+denies access if the HTTP Referer header does not start with
+"http://www.example.com/".</p>
+<example>
+&lt;If "!(%{HTTP_REFERER} -strmatch 'http://www.example.com/*')"&gt;<br />
+Require all denied<br />
+&lt;/If&gt;
+</example>
+
+</section>
+
 <section id="whichwhen"><title>What to use When</title>
 
 <p>Choosing between filesystem containers and webspace containers is
@@ -354,6 +368,21 @@ rule.  Putting configuration restrictions in a <code>&lt;Location
 to all requests regardless of the specific URL.</p>
 </section>
 
+<section id="nesting"><title>Nesting of sections</title>
+
+<p>Some section types can be nested inside other section types. One the one
+hand, <directive type="section" module="core">File</directive> can be used
+inside <directive type="section" module="core">Directory</directive>.  On
+the other hand, <directive type="section" module="core">If</directive> can
+be used inside <directive type="section" module="core">Directory</directive>,
+<directive type="section" module="core">Location</directive>, and <directive
+type="section" module="core">Files</directive> sections. The regex
+counterparts of the named section behave identically.</p>
+
+<p>Nested sections are merged after non-nested sections of the same type.</p>
+
+</section>
+
 </section>
 
 <section id="virtualhost"><title>Virtual Hosts</title>
@@ -444,6 +473,10 @@ are interpreted, it is important to understand how this works.</p>
       <li><directive type="section" module="core">Location</directive>
       and <directive type="section"
       module="core">LocationMatch</directive> done simultaneously</li>
+
+      <li><directive type="section" module="core">If</directive>
+      </li>
+
     </ol>
 
     <p>Apart from <directive type="section"