regex - htaccess match & sign -
i want have rule in .htaccess forward /test/abc&d /test.php?s=abc&d
i tried following rule. result forward /test.php?s=abc . '&d' missing url.
rewriterule ^test/([^.]+)$ /test.php?s=$1 [pt]
you have behaviour because considers &
separator in query string.
result, have first data s
containing abc
, second data d
empty.
to pass &
in url, have encode it: %26
.
that's why b
flag exists. can try rule:
rewriterule ^test/([^.]+)$ /test.php?s=$1 [pt,b]
more info on b
flag here
Comments
Post a Comment