New answers tagged

3

RewriteCond %{QUERY_STRING} (^|&)v1=123&v2=(\d+).*$ RewriteRule ^sub/$ sub/?v1=789&v2=%1 [NE] You are using the wrong backreference in the substitution string. You have 2 capturing subgroups in the preceding condition, so you would need to use %2, not %1 as you have done. %1 is a backreference to the first captured subgroup, ie. (^|&) - ...


1

%1 is the contents from the first set of parenthesis in your rewrite condition. You have used TWO sets of parenthesis: (^|&) and (\d+). %1 is matching the first of those which contains nothing but the "start of the expression" (^), so no characters. You have two possible solutions: Change your rewrite rule from using %1 to using %2. Change your ...


Top 50 recent answers are included