Yii Framework Forum: Lighttpd Rewrite Rules - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Lighttpd Rewrite Rules Rate Topic: -----

#1 User is offline   sAe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-May 09
  • Location:Sweden, Karlstad

Posted 21 July 2009 - 12:30 AM

Hello!

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!

/Martin
0

#2 User is offline   sAe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-May 09
  • Location:Sweden, Karlstad

Posted 23 July 2009 - 12:20 AM

bump

To be more clear, i might have a url that looks like: www.domain.com/controller/action?id=123.
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") 

and
 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.

/Martin


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?

This post has been edited by sAe: 23 July 2009 - 12:56 AM

0

#3 User is offline   Philipp Waldhauer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 05-September 11

Posted 05 September 2011 - 05:37 AM

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")

Greetings
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users