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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -