From 89f3342eebd788e8ff53e3bf4074fbfbbce4f8f7 Mon Sep 17 00:00:00 2001
From: Luca Toscano
www.example.com
website.
+that match the specified URL. For example, the following configuration
+will allow only a subset of clients to access the
+www.example.com
website using the proxy server:
Later sections override earlier ones, however each module is responsible - for interpreting what form this override takes. A later configuration section - with directives from a given module might cause a conceptual "merge" of some - directives, all directives, or a complete replacement of the modules - configuration with the module defaults and directives explicitly listed in - the later context.
- -<Location>
/<LocationMatch>
sequence performed just before the name translation phase
@@ -525,9 +518,53 @@ are interpreted, it is important to understand how this works.
are used to map URLs to filenames). The results of this
sequence are completely thrown away after the translation has
completed.
-One question that often arises after reading how configuration sections are
+ merged is related to how and when directives of specific modules like
At runtime, the core of httpd iterates over the defined configuration sections in the order + described above to determine which ones apply to the current request. When the first section matches, + it is considered the current configuration for this request. If a subsequent section matches too, + then each module with a directive in either of the sections is given a chance to merge its configuration between the two sections. The result is a third configuration, and the process goes on until all the configuration sections + are evaluated.
+After the above step, the "real" processing of the HTTP request begins: each module has a chance to run + and perform whatever tasks they like. They can retrieve their own final merged configuration from the core + of the httpd to determine how they should act.
+An example can help to visualize the whole process. The following configuration uses the
+ CustomHeaderName
header for a request to
+ /example/index.html
?
+
CustomHeaderName
header with the value one
is created.CustomHeaderName
header with the value two
.CustomHeaderName
header to be set with the value three
.CustomHeaderName
header with the value three
. This is true for .htaccess too since they have the same priority as
Below is an artificial example to show the order of merging. Assuming they all apply to the request, the directives in @@ -559,6 +596,7 @@ E.
+For a more concrete example, consider the following. Regardless of
any access restrictions placed in