How To Remove Action From Url Bar ?

I’m using the urlManager and I can not figure out a way to get rid of “action”, replacing it by my pre-defined default action

Let me explain:

I want URL’s that look like these:

index.php/garagemo/car/id/80

index.php/garagemo/car/aaa/2/bbb/jacky/ccc/807

Which needs to be translated into these:

index.php?r=garagemo/car/show&id=80

index.php?r=garagemo/car/show&aaa=2&bbb=jacky&ccc=807

So I thought this would work:

‘rules’=>array(

<module:\w+>/<controller:\w+>/’ => ‘<module>/<controller>/show’,

),

but this leads to the following error:

The system is unable to find the requested action "id".

or

The system is unable to find the requested action "aaa".

It always grabs my first parameter, and acts as if it’s an action, although I believe I’ve explicitly asked to use “show” as the action all the time, as you can see in the right part of my rule.

I tried many combinations, but none of them worked.

Does someone here knows what’s going wrong or how to solve this?

[color="#2E8B57"]/* moved from "Miscellaneous" to "General Discussion for Yii 1.1.x" */[/color]

Hello

Have you tried like this:


<module:\w+>/<controller:\w+>/*' => '<module>/<controller>/show',

I’m referring to http://www.yiiframework.com/doc/guide/1.1/en/topics.url#using-named-parameters

This works, thanks!

I never tried the "/*" and that seems to do the trick!