Lighttpd Rewrite Rules


With trial and fail i managed to build:

 url.rewrite-once = (".*\.(js|gif|jpg|png|css|swf)\??" => "$0", "" => "/index.php")


However for some reason Yii is not getting any $_GET ( ?key=val ) but /action/id/get-key/get-val works as usual.

Anyone who can shed some light on my faulty regex? Thanks!



[/i]To be more clear, i might have a url that looks like:

I’m pretty sure my regex is passing everything to Yii, but is Yii maybe ignoring them?

I’ve tried:

 url.rewrite-once = (".*\.(js|gif|jpg|png|css|swf)\??" => "$0", "" => "/index.php") 


 url.rewrite-once = (".*\.(js|gif|jpg|png|css|swf)\??" => "$0", "" => "/index.php") 

Both without any success. Just to make sure there wasn’t any other server problems i tried just printing out $_GET without rewrite url activated

and they showed up. So my conclusion is that either my regex is wrong or Yii is not taking them into consideration?

I’m using pretty urls in the rest of my application, it’s just this single service in my app that relies on third party that has to be designed this way.

Thank you for your time.


EDIT: it came to my mind that i could just dump the REQUEST_URI, so i did. Turns out that my querysting don’t get into $_GET, is there any other way to reach them in Yii or should i extract them myself?

Well, this post is quite old, but no one seems to have a solution.

I got the problem myself and here is what I worked out:

Add another rule:

"^(.)\?(.)" => "index.php$1?$2"

So, it gets

url.rewrite-once = (".*\.(js|gif|jpg|png|css|swf)\??" => "$0",

"^(.)\?(.)" => "index.php$1?$2", "" => "/index.php")