mirror of
https://github.com/apache/httpd.git
synced 2026-01-06 09:01:14 +03:00
Documentation rebuild
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731193 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -478,33 +478,32 @@ are interpreted, it is important to understand how this works.</p>
|
||||
of the httpd to determine how they should act.</p>
|
||||
<p>An example can help to visualize the whole process. The following configuration uses the
|
||||
<code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> directive of <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> to set
|
||||
a specific HTTP header. What value will httpd set in the <code>foo</code> header for a request to
|
||||
a specific HTTP header. What value will httpd set in the <code>CustomHeaderName</code> header for a request to
|
||||
<code>/example/index.html</code> ?
|
||||
</p>
|
||||
<pre class="prettyprint lang-config"><Directory "/">
|
||||
Header set foo one
|
||||
Header set CustomHeaderName one
|
||||
<FilesMatch ".*">
|
||||
Header set foo three
|
||||
Header set CustomHeaderName three
|
||||
</FilesMatch>
|
||||
</Directory>
|
||||
|
||||
<Directory "/example">
|
||||
Header set foo two
|
||||
Header set CustomHeaderName two
|
||||
</Directory></pre>
|
||||
|
||||
<ul>
|
||||
<li><code class="directive">Directory</code> "/" matches and an initial configuration to set the "foo" header with the value "one" is created.</li>
|
||||
<li><code class="directive">Directory</code> "/example" matches, and since <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> specifies in its code to override in case of a merge, a new configuration is created to set the "foo" header with the value "two".</li>
|
||||
<li><code class="directive">FilesMatch</code> ".*" matches and another merge opportunity arises, causing the "foo" header
|
||||
to be set with the value "three".</li>
|
||||
<li>Eventually during the next steps of the HTTP request processing <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> will be called and it will receive the configuration to set the "foo" header with the value "three". <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> normally uses this configuration to perfom its job, namely setting the foo header. This does not mean that a module can't perform a more complex action like discarding directives because not needed or deprecated, etc..</li>
|
||||
<li><code class="directive">Directory</code> "/" matches and an initial configuration to set the <code>CustomHeaderName</code> header with the value <code>one</code> is created.</li>
|
||||
<li><code class="directive">Directory</code> "/example" matches, and since <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> specifies in its code to override in case of a merge, a new configuration is created to set the <code>CustomHeaderName</code> header with the value <code>two</code>.</li>
|
||||
<li><code class="directive">FilesMatch</code> ".*" matches and another merge opportunity arises, causing the <code>CustomHeaderName</code> header to be set with the value <code>three</code>.</li>
|
||||
<li>Eventually during the next steps of the HTTP request processing <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> will be called and it will receive the configuration to set the <code>CustomHeaderName</code> header with the value <code>three</code>. <code class="module"><a href="./mod/mod_headers.html">mod_headers</a></code> normally uses this configuration to perfom its job, namely setting the foo header. This does not mean that a module can't perform a more complex action like discarding directives because not needed or deprecated, etc..</li>
|
||||
</ul>
|
||||
|
||||
<p>This is true for .htaccess too since they have the same priority as <code class="directive">Directory</code> in the merge order. The important concept to understand is that configuration sections like <code class="directive">Directory</code> and <code class="directive">FilesMatch</code> are not comparable to module specific directives like <code class="directive"><a href="./mod/mod_headers.html#header">Header</a></code> or <code class="directive"><a href="./mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> because they operate on different levels.
|
||||
</p>
|
||||
|
||||
|
||||
<h3><a name="merge-examples" id="merge-examples">Some useful merge examples to practice</a></h3>
|
||||
<h3><a name="merge-examples" id="merge-examples">Some useful examples</a></h3>
|
||||
|
||||
<p>Below is an artificial example to show the order of
|
||||
merging. Assuming they all apply to the request, the directives in
|
||||
|
||||
Reference in New Issue
Block a user