diff options
author | Graham Leggett <minfrin@apache.org> | 2022-01-17 17:10:51 +0100 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2022-01-17 17:10:51 +0100 |
commit | c51dccd833ccaec00df9420701c879ca6fb0e3b4 (patch) | |
tree | a2cac77ceb793e94c8e774f0efb2800b611be3fc /docs/manual/mod/core.xml | |
parent | bump autuconf min to 2.60 (diff) | |
download | apache2-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.xml | 55 |
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"> +<Directory ~ /home/%{env:MATCH_PARTITIONNAME}/dav/ ^/dav/(?<PARTITIONNAME>[^/]+)/> + Dav on +</Directory> + </highlight> + <p><strong>Note that the default access for <code><Directory "/"></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><DirectoryMatch <var>regex</var>> +<syntax><DirectoryMatch [<var>expr</var>] <var>regex</var>> ... </DirectoryMatch></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 </DirectoryMatch> </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"> +<DirectoryMatch /home/%{env:MATCH_PARTITIONNAME}/dav/ ^/dav/(?<PARTITIONNAME>[^/]+)/> + Dav on +</DirectoryMatch> + </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> </Location> </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"> +<Location ~ /dav/%{env:MATCH_PARTITIONNAME} ^/dav/(?<PARTITIONNAME>[^/]+)/> + Dav on +</Location> + </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><LocationMatch - <var>regex</var>> ... </LocationMatch></syntax> + [<var>expr</var>] <var>regex</var>> ... </LocationMatch></syntax> <contextlist><context>server config</context><context>virtual host</context> </contextlist> @@ -3250,6 +3289,18 @@ matching URLs</description> </LocationMatch> </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"> +<LocationMatch /dav/%{env:MATCH_PARTITIONNAME} ^/dav/(?<PARTITIONNAME>[^/]+)/> + Dav on +</LocationMatch> + </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 |