Help with Url Manager path rules

Hi, I need some help defining some specific path rules and I am not sure what the correct syntax is.

Basically, what I want is:


http://localhost/mysite/index.php?r=controller/action&site=unique-site-url-name

to become:


http://localhost/mysite/index.php/site/unique-site-url-name/controller/action

(I know how to remove the entry script so for the sake of simplicity just ignore that)

Based on what I am trying to achieve I think I need something like:




array(

    '<site: \w+>/controller/action'=>'controller/action',

)



I haven’t tested this yet so I could be totally wrong hence why I decided to ask on here. Additionally even if the rule above would work I would like a rule to apply to all controllers so that I don’t need to write a new rule for every controller/action in the application.

Any advice would be greatly appreciated,

Thanks,

Matt

http://www.yiiframework.com/doc/guide/topics.url#parameterizing-routes