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
<directive module="mod_headers">Header</directive> directive of <module>mod_headers</module> 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>
<highlight language="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>
</highlight>
<ul>
- <li><directive>Directory</directive> "/" matches and an initial configuration to set the "foo" header with the value "one" is created.</li>
- <li><directive>Directory</directive> "/example" matches, and since <module>mod_headers</module> 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><directive>FilesMatch</directive> ".*" 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 <module>mod_headers</module> will be called and it will receive the configuration to set the "foo" header with the value "three". <module>mod_headers</module> 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><directive>Directory</directive> "/" matches and an initial configuration to set the <code>CustomHeaderName</code> header with the value <code>one</code> is created.</li>
+ <li><directive>Directory</directive> "/example" matches, and since <module>mod_headers</module> 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><directive>FilesMatch</directive> ".*" 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 <module>mod_headers</module> will be called and it will receive the configuration to set the <code>CustomHeaderName</code> header with the value <code>three</code>. <module>mod_headers</module> 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 <directive>Directory</directive> in the merge order. The important concept to understand is that configuration sections like <directive>Directory</directive> and <directive>FilesMatch</directive> are not comparable to module specific directives like <directive module="mod_headers">Header</directive> or <directive module="mod_rewrite">RewriteRule</directive> because they operate on different levels.
</p>
</section>
-<section id="merge-examples"><title>Some useful merge examples to practice</title>
+<section id="merge-examples"><title>Some useful examples</title>
<p>Below is an artificial example to show the order of
merging. Assuming they all apply to the request, the directives in
</Files>
<VirtualHost *>
-<Directory "/a/emphasis role="bold"">
- B
-</Directory>
+ <Directory "/a/">
+ B
+ </Directory>
</VirtualHost>
<DirectoryMatch "^.*b$">
C
</DirectoryMatch>
-<Directory "/a/b>
+<Directory "/a/b">
A
</Directory>