regex - How to rewrite url while keeping additional parameters in .htaccess file? -
i have standard htaccess catches , puts 1 url parameter later processed in code...
rewriterule ^config/ - [f] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !=/favicon.ico rewriterule ^(.*)$ index.php?q=$1 [l,qsa]
i use "pretty" url params
/some/route/param1/value1/param2/value2
but need ability add "regular" url params like
/some/route/param1/value1?param2=value2¶m3=value3 etc
i tried adding
rewriterule ^(.*)\?(.*)$ index.php?q=$1&p=$2 [l,qsa]
before existing rule, won't work (and suspect work 1 parameter).
try this:
rewriterule ^([^?]+)\?(.*)$ index.php?q=$1&p=$2 [l,qsa]
Comments
Post a Comment