views:

512

answers:

1

I'm trying to rewrite the following URL

test.php?par1=foo&par2=bar

Into...

newtest.php?hidden_par=blah&par1=foo&par2=bar

I have this rule, that does not work:

RewriteRule ^test.php\??(.*?)$ newtest.php?hiden_par=blah&$1 [L]

Could this be done using RewriteCond or something else? (say, could this be done ?), thanks in advance.

+9  A: 

You probably want something like the QSA ("query string append") flag, which causes the remainder of the query string to be properly appended onto the end of the rewritten URL.

For example:

^test.php test.php?hidden=value [L,QSA]
Rob
Works great !! thak you..
grilix