summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/core.xml
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2022-01-17 17:10:51 +0100
committerGraham Leggett <minfrin@apache.org>2022-01-17 17:10:51 +0100
commitc51dccd833ccaec00df9420701c879ca6fb0e3b4 (patch)
treea2cac77ceb793e94c8e774f0efb2800b611be3fc /docs/manual/mod/core.xml
parentbump autuconf min to 2.60 (diff)
downloadapache2-c51dccd833ccaec00df9420701c879ca6fb0e3b4.tar.xz
apache2-c51dccd833ccaec00df9420701c879ca6fb0e3b4.zip
core: Allow an optional expression to be specified for an effective
path in the DirectoryMatch and LocationMatch directives. This allows modules like mod_dav to map URLs to URL spaces or to directories on the filesystem. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897156 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/mod/core.xml')
-rw-r--r--docs/manual/mod/core.xml55
1 files changed, 53 insertions, 2 deletions
diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml
index e22545e8cf..1b98107146 100644
--- a/docs/manual/mod/core.xml
+++ b/docs/manual/mod/core.xml
@@ -926,6 +926,20 @@ named file-system directory, sub-directories, and their contents.</description>
the corresponding <directive type="section">Directory</directive> will
be applied.</p>
+ <p>Some modules require the directory-path prefix in order to do their work,
+ and when a regular expression is provided the directory-path is no longer
+ available. From 2.5.1 onwards, an expression can be specified in addition
+ to the regular expression that resolves to the directory-path prefix. This
+ can allow complex mappings from the URL space to an effective directory.
+ This funcionality is identical to that provided by the
+ <directive>DirectoryMatch</directive> directive below.</p>
+
+ <highlight language="config">
+&lt;Directory ~ /home/%{env:MATCH_PARTITIONNAME}/dav/ ^/dav/(?&lt;PARTITIONNAME&gt;[^/]+)/&gt;
+ Dav on
+&lt;/Directory&gt;
+ </highlight>
+
<p><strong>Note that the default access for
<code>&lt;Directory "/"&gt;</code> is to permit all access.
This means that Apache httpd will serve any file mapped from an URL. It is
@@ -959,7 +973,7 @@ named file-system directory, sub-directories, and their contents.</description>
<name>DirectoryMatch</name>
<description>Enclose directives that apply to
the contents of file-system directories matching a regular expression.</description>
-<syntax>&lt;DirectoryMatch <var>regex</var>&gt;
+<syntax>&lt;DirectoryMatch [<var>expr</var>] <var>regex</var>&gt;
... &lt;/DirectoryMatch&gt;</syntax>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
@@ -1007,6 +1021,18 @@ the contents of file-system directories matching a regular expression.</descript
Require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example
&lt;/DirectoryMatch&gt;
</highlight>
+
+ <p>Some modules require the directory-path prefix in order to do their work,
+ and when a regular expression is provided the directory-path is no longer
+ available. From 2.5.1 onwards, an expression can be specified in addition
+ to the regular expression that resolves to the directory-path prefix. This
+ can allow complex mappings from the URL space to an effective directory.</p>
+
+ <highlight language="config">
+&lt;DirectoryMatch /home/%{env:MATCH_PARTITIONNAME}/dav/ ^/dav/(?&lt;PARTITIONNAME&gt;[^/]+)/&gt;
+ Dav on
+&lt;/DirectoryMatch&gt;
+ </highlight>
</usage>
<seealso><directive type="section" module="core">Directory</directive> for
a description of how regular expressions are mixed in with normal
@@ -3172,6 +3198,19 @@ URLs</description>
&lt;/Location&gt;
</highlight>
+ <p>Some modules require the URL-path prefix in order to do their work, and when
+ a regular expression is provided the URL-path is no longer available. From
+ 2.5.1 onwards, an expression can be specified in addition to the regular
+ expression that resolves to the URL-path prefix. This can allow complex
+ mappings from the URL space to an effective path. This funcionality is identical
+ to that provided by the <directive>LocationMatch</directive> directive below.</p>
+
+ <highlight language="config">
+&lt;Location ~ /dav/%{env:MATCH_PARTITIONNAME} ^/dav/(?&lt;PARTITIONNAME&gt;[^/]+)/&gt;
+ Dav on
+&lt;/Location&gt;
+ </highlight>
+
<note><title>Note about / (slash)</title>
<p>The slash character has special meaning depending on where in a
URL it appears. People may be used to its behavior in the filesystem
@@ -3207,7 +3246,7 @@ URLs</description>
<description>Applies the enclosed directives only to regular-expression
matching URLs</description>
<syntax>&lt;LocationMatch
- <var>regex</var>&gt; ... &lt;/LocationMatch&gt;</syntax>
+ [<var>expr</var>] <var>regex</var>&gt; ... &lt;/LocationMatch&gt;</syntax>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
@@ -3250,6 +3289,18 @@ matching URLs</description>
&lt;/LocationMatch&gt;
</highlight>
+ <p>Some modules require the URL-path prefix in order to do their work, and when
+ a regular expression is provided the URL-path is no longer available. From
+ 2.5.1 onwards, an expression can be specified in addition to the regular
+ expression that resolves to the URL-path prefix. This can allow complex
+ mappings from the URL space to an effective path.</p>
+
+ <highlight language="config">
+&lt;LocationMatch /dav/%{env:MATCH_PARTITIONNAME} ^/dav/(?&lt;PARTITIONNAME&gt;[^/]+)/&gt;
+ Dav on
+&lt;/LocationMatch&gt;
+ </highlight>
+
<note><title>Note about / (slash)</title>
<p>The slash character has special meaning depending on where in a
URL it appears. People may be used to its behavior in the filesystem