]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
doc BNEG, improve related
authorEric Covener <covener@apache.org>
Mon, 13 Mar 2023 15:52:49 +0000 (15:52 +0000)
committerEric Covener <covener@apache.org>
Mon, 13 Mar 2023 15:52:49 +0000 (15:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908352 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_rewrite.xml
docs/manual/rewrite/flags.xml

index 8d21cbb7fedb62a904ea171f6a472961698fd5e0..0e196a9dbf0ccf5f32bfdeb6b42c06bccc5081d7 100644 (file)
@@ -1336,6 +1336,11 @@ cannot use <code>$N</code> in the substitution string!
         applying the transformation. <em><a
         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
index 9af48d6d5e7762a17d48b940cec329cf4b6900a7..9719e307cf732c168114abb579176a46ace0f108 100644 (file)
@@ -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>