Urlmanager Help Me

I have 2 modules in my applications: admin and customer.

My goal is to use SEO friendly URL to call all the views of my application.

For example: /customer/restaurant/view/34/My+Shop

If I use this simple code in all my webpages it works fine:


but unfortunately in all my web pages I have this code


Actually my URL MANAGER settings are the following:







                '<controller:\w+>/<action:\w+>/<id:\d+>/<title:.*?>' => '<controller>/<action>',                   



Can you please help me to understand how to set URL MANAGER??

something like

‘/customer/restaurant/view/<id:\d+>/<title:\w+>’ => ‘restaurant/view’

public function actionView($id, $title)



I’ve tried to add your rule to my URL MANAGER





   '/customer/restaurant/view/&lt;id:&#092;d+&gt;/&lt;title:&#092;w+&gt;' =&gt; 'restaurant/view',			

   '&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'	    =&gt; '&lt;controller&gt;/&lt;action&gt;',   



The address is displayed corretly (//localhost/myapp/customer/restaurant/view/34/My+Shop) on the source page, but once I click on the link there is a problem on the destination page: "404 error: Page not found"


paste your action code.


Try this (I added the space char to the character class):

'/customer/restaurant/view/<id:\d+>/<title:[\w ]+>' => 'restaurant/view',

Dear all,

I found the solution.

It was a double problem:

  1. routing the requests to customer module

  2. decoding SEO friendly url

These are my settings for URL MANAGER.


‘restaurant/<action>/*’ => ‘customer/restaurant/<action>’,


‘<controller:\w+>/<action:\w+>/<title:.*?>’ => ‘<controller>/<action>’,

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

Thank you all for your help.