regex - htaccess RewriteRule, how do should it handle hex codes -


i have following line of code in .htaccess file:

rewriterule ^mypage/(.+)/$ mypage.php?a=$1 

this rewriterule works of time. however, if try passing parameter c++, mypage/c%2b%2b/ not work properly. should go mypage.php?a=c%2b%2b... instead seems mypage.php?a=c++ , the php code sees value of a=c<space><space>

how can update rewriterule pass hex coding rewritten url ?

thank in advance

trick use b flag. per manual:

the [b] flag instructs rewriterule escape non-alphanumeric characters before applying transformation.

read more here in doc.

your modified rule should this:

rewriterule ^mypage/(.+?)/?$ mypage.php?a=$1 [l,qsa,nc,b] 

Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -