URL management using Yii

94 Views Asked by At

I have url: /profile/profileBase/index where "profile" is module, "profileBase" is controller and "index" is action. I want to url manager would accept route like: /profile/read/index where "read" could be alias of controller. Is there any way to do this using url manager rules? Thanks

2

There are 2 best solutions below

0
On BEST ANSWER
   'urlManager' => array(
        'urlFormat' => 'path',
        'showScriptName' => false,
        'rules' => array(
          'profile/read/index '=>'profile/profileBase/index'
        ),
    ),
0
On

You should simply add the following rule in urlManager config :

'profile/read/index'=>'profile/profileBase/index',