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&param3=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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -