summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2023-03-13 15:52:49 +0000
committerEric Covener <covener@apache.org>2023-03-13 15:52:49 +0000
commited87e4619419909a75c6498f39984277130ea677 (patch)
tree89222eb85d04cbc772fdcf66214eb49ae4fa620c /docs
parent607e722f5837dcef78252bc6990db1c5bccb6638 (diff)
downloadhttpd-ed87e4619419909a75c6498f39984277130ea677.tar.gz
doc BNEG, improve related
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908352 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs')
-rw-r--r--docs/manual/mod/mod_rewrite.xml5
-rw-r--r--docs/manual/rewrite/flags.xml33
2 files changed, 37 insertions, 1 deletions
diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml
index 8d21cbb7fe..0e196a9dbf 100644
--- a/docs/manual/mod/mod_rewrite.xml
+++ b/docs/manual/mod/mod_rewrite.xml
@@ -1337,6 +1337,11 @@ cannot use <code>$N</code> in the substitution string!
href="../rewrite/flags.html#flag_b">details ...</a></em></td>
</tr>
<tr>
+ <td>BCTLS</td>
+ <td>Like [B], but only escape control characters and spaces.
+ <em><a href="../rewrite/flags.html#flag_bctls">details ...</a></em></td>
+ </tr>
+ <tr>
<td>backrefnoplus|BNP</td>
<td>If backreferences are being escaped, spaces should be escaped to
%20 instead of +. Useful when the backreference will be used in the
diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml
index 9af48d6d5e..9719e307cf 100644
--- a/docs/manual/rewrite/flags.xml
+++ b/docs/manual/rewrite/flags.xml
@@ -113,10 +113,13 @@ the entire third argument of <directive module="mod_rewrite">RewriteRule</direct
and the space must not be the last character in the list.</p>
<highlight language="config">
-# Escape spaces and question marks.
+# Escape spaces and question marks. The quotes around the final argument
+# are required when a space is included.
RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
</highlight>
+<p>To limit the characters escaped this way, see <a href="flag_bneg">flag_bneg</a>
+and <a href="flag_bctls">flag_bctls</a></p>
</section>
<section id="flag_bnp"><title>BNP|backrefnoplus (don't escape space to +)</title>
@@ -125,6 +128,13 @@ module="mod_rewrite">RewriteRule</directive> to escape the space character
in a backreference to %20 rather than '+'. Useful when the backreference
will be used in the path component rather than the query string.</p>
+<highlight language="config">
+# Escape spaces to %20 in the path instead of + as used in form submission via
+# the query string
+RewriteRule "^search/(.*)$" "/search.php/$1" "[B,BNP]"
+</highlight>
+
+
<p>This flag is available in version 2.4.26 and later.</p>
</section>
@@ -133,8 +143,29 @@ will be used in the path component rather than the query string.</p>
control characters and the space character. This is the same set of
characters rejected when they are copied into the query string unencoded.
</p>
+
+<highlight language="config">
+# Escape control characters and spaces
+RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
+</highlight>
+
+
<p>This flag is available in version 2.5.1 and later.</p>
+</section>
+
+<section id="flag_bneg"><title>BNEG</title>
+ <p>The [BNEG] flag modifies the behavior of escaping when the
+ the [B] flag is used with a list of specific characters to escape.
+ When [BNEG] is specified, the list of characters passed with [B=...]
+ are treated as exclusions to the list of characters to be escaped.
+ </p>
+<highlight language="config">
+# Escape the default characters, but leave /
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B=/,BNEG]"
+</highlight>
+
+<p>This flag is available in version 2.5.1 and later.</p>
</section>
<section id="flag_c"><title>C|chain</title>