From fabd4abceffc2eeb296203796bdf0aeb34f2ad51 Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Tue, 5 Aug 1997 10:49:44 +0000 Subject: [PATCH] Enhanced and cleaned up the URL rewriting engine for 1.3: First the grouped parts of RewriteRule pattern matches (parenthesis!) can be accessed now via backreferences $1..$9 in RewriteConds test-against strings in addition to RewriteRules subst string. Second the grouped parts of RewriteCond pattern matches (parenthesis!) can be accessed now via backreferences %1..%9 both in following RewriteCond test-against strings and RewriteRules subst string. This provides maximum flexibility through the use of backreferences. Additionally the rewriting engine was cleaned up by putting common code to the new expand_backrefs_inbuffer() function. Submitted by: Ralf S. Engelschall Reviewed by: Dean Gaudet, Ralf S. Engelschall git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@78903 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_rewrite.html | 53 ++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/docs/manual/mod/mod_rewrite.html b/docs/manual/mod/mod_rewrite.html index 0d2ed22582..a67387ab90 100644 --- a/docs/manual/mod/mod_rewrite.html +++ b/docs/manual/mod/mod_rewrite.html @@ -471,7 +471,34 @@ The following rewriting rule is only used if its pattern matches the current state of the URI AND if these additional conditions apply, too.

-TestString is a string which contains server-variables of the form +TestString is a string which can contains the following +expanded constructs in addition to plain text: + +

+

Special Notes:

    @@ -796,7 +824,8 @@ which is substituted for (or replaces) the original URL for which Pattern matched. Beside plain text you can use
      -
    1. pattern-group back-references ($N) +
    2. back-references $N to the RewriteRule pattern +
    3. back-references %N to the last matched RewriteCond pattern
    4. server-variables as in rule condition test-strings (%{VARNAME})
    5. mapping-function calls (${mapname:key|default})
    @@ -1007,15 +1036,15 @@ comma-separated list of the following flags: (This is not the same as the 'chain|C' flag!)

  1. 'env|E=VAR:VAL' (set environment variable)
    - This forces an environment variable named VAR to be set to the value - VAL, where VAL can contain regexp backreferences $N - which will be expanded. You can use this flag more than once to set more - than one variable. The variables can be later dereferenced at a lot of - situations, but the usual location will be from within XSSI (via - <!--#echo var="VAR"-->) or CGI (e.g. $ENV{'VAR'}). - But additionally you can also dereference it in a following RewriteCond - pattern via %{ENV:VAR}. Use this to strip but remember - information from URLs. + This forces an environment variable named VAR to be set to the + value VAL, where VAL can contain regexp backreferences + $N and %N which will be expanded. You can use this flag + more than once to set more than one variable. The variables can be later + dereferenced at a lot of situations, but the usual location will be from + within XSSI (via <!--#echo var="VAR"-->) or CGI (e.g. + $ENV{'VAR'}). But additionally you can also dereference it in a + following RewriteCond pattern via %{ENV:VAR}. Use this to strip + but remember information from URLs.

    -- 2.40.0