From: Eric Covener
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= ?]"+ + +
The [B] flag instructs
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
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