Hi,
Im new in Yii and Im trying to create an application that needs to parse the URLs on a special way. as follows:
if the first part of the URL isn’t a valid controller and the second part isn’t a valid action, then, calls site/pages, passing as parameters the frist and second parts as enterprise and area respetivelly.
In the site/pages action I’ll try to find a page content on the database with the enterprise and area parameters passed. If nothing was found, then redirec the application to not found page.
I would like to do that to reduce front pages URLs to be only www.mysite.com/enterpriseName/areaContentName.
Does that can be done?
I tried that
‘urlManager’=>array(
'urlFormat'=>'path',
'rules'=>array(
'<enterprise:(^(controller))>/<area:(^(action))>'=>'site/pages',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
thanks in advance and sorry about the terrible english.