From: Eric Covener Date: Sat, 11 Mar 2023 22:41:08 +0000 (+0000) Subject: Merge r1908302 from trunk: X-Git-Tag: 2.4.57-rc1-candidate~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=114adea813e5b2f5f18b4c19e0e9e6390507e9a7;p=thirdparty%2Fapache%2Fhttpd.git Merge r1908302 from trunk: move B=xx example to the bottom show example with quoted flags and a space [skip ci] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1908303 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index 5ffd1b2eb04..caa4883f450 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -85,10 +85,6 @@ of how you might use them.

B (escape backreferences)

The [B] flag instructs RewriteRule to escape non-alphanumeric characters before applying the transformation.

-

In 2.4.26 and later, you can limit the escaping to specific characters -in backreferences by listing them: [B=#?;]. Note: The space -character can be used in the list of characters to escape, but it cannot be -the last character in the list.

mod_rewrite has to unescape URLs before mapping them, so backreferences are unescaped at the time they are applied. @@ -120,6 +116,18 @@ when the backend may break if presented with an unescaped URL.

An alternative to this flag is using a RewriteCond to capture against %{THE_REQUEST} which will capture strings in the encoded form.

+ +

In 2.4.26 and later, you can limit the escaping to specific characters +in backreferences by listing them: [B=#?;]. Note: The space +character can be used in the list of characters to escape, but you must quote +the entire third argument of RewriteRule +and the space must not be the last character in the list.

+ +
# Escape spaces and question marks. 
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
+ + +
top

BNP|backrefnoplus (don't escape space to +)

diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index 41dfcac57c1..d6855db0b98 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -70,10 +70,6 @@ of how you might use them.

The [B] flag instructs RewriteRule to escape non-alphanumeric characters before applying the transformation.

-

In 2.4.26 and later, you can limit the escaping to specific characters -in backreferences by listing them: [B=#?;]. Note: The space -character can be used in the list of characters to escape, but it cannot be -the last character in the list.

mod_rewrite has to unescape URLs before mapping them, so backreferences are unescaped at the time they are applied. @@ -109,6 +105,19 @@ when the backend may break if presented with an unescaped URL.

An alternative to this flag is using a RewriteCond to capture against %{THE_REQUEST} which will capture strings in the encoded form.

+ +

In 2.4.26 and later, you can limit the escaping to specific characters +in backreferences by listing them: [B=#?;]. Note: The space +character can be used in the list of characters to escape, but you must quote +the entire third argument of RewriteRule +and the space must not be the last character in the list.

+ + +# Escape spaces and question marks. +RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]" + + +
BNP|backrefnoplus (don't escape space to +)