I’m using a Yii folder structure like the one described here http://www.yiiframework.com/wiki/33/organize-directories-for-applications-with-front-end-and-back-end
I forced the admin role check before each request. And it’s ok.
Now i’m facing a problem: if i’m in domain/backend.php and i create a url to “site/contact”, it will go anyway to domain/site/contact and not to domain/backend.php/site/contact.
I’ve found a solution modifing the “rules” array of the “urlManager” component in backend/config/main.php, that’s what:
'urlManager' => array(
'urlFormat' => 'path',
'rules' => array(
'backend.php/<controller:\w+>/<id:\d+>' => '<controller>/view',
'backend.php/<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'backend.php/<controller:\w+>/<action:\w+>' => '<controller>/<action>',
'backend.php/<view:(about)>' => 'site/page',
'backend.php/' => 'site/index',
),
'showScriptName' => false,
),
It’s working well, but i would like to know from you if it is a good way to use it and if you have a different and solid solution.
Thanks