cris
cris

Reputation: 13

URL rewrite in lighttpd

I have the following query:

update234ae5.php?q=1&q=2....

must be rewritten to:

update.php?cond=234ae5&q=1&q=2....

I use:

"^/update(([a-zA-Z0-9]+))"  =>  "/update.php?cond=$1"

How can I add the rest of url string, because my url is rewritten to

update.php?cond=234ae5& 

without the rest of params

In Apache I use

RewriteCond %{QUERY_STRING} (.*)  
RewriteRule ^/update([0-9a-z]+).php /update.php?cond=$1&%1

Upvotes: 1

Views: 1270

Answers (1)

Conspicuous Compiler
Conspicuous Compiler

Reputation: 6469

As the lighttpd documentation states:

If you wanna pass the Query String (?foo=bar) to the rewrite destination you have to explicitly match it:

So you'll want something like:

"^/update([a-zA-Z0-9]+)\.php(\?(.+))?" => "/update.php?cond=$1&$3"

Upvotes: 2

Related Questions