Invalid redirection problem

Hi,

I’m very new to Yii.

I’m starting a new project with backend and frontend. I found andy_s cookbook reciept “Organize directories for applications with front-end and back-end using WebApplicationEnd behavior”, I thing it is great idea, and project structure suits my application the best.

I’ve done everything like in this reciept, but I’m having problem with redirection to login page. When I try to get to backend and application should redirect me to login page, the web browser throws an error “Invalid redirection”.

Here is my admin config file:




return CMap::mergeArray(

    require(dirname(__FILE__).'/main.php'),

    array(

		'components' => array(

			'user'=>array(

				// enable cookie-based authentication

				'allowAutoLogin' => true,

				'loginUrl' => array('admin/login'),

			),

			'urlManager' => array(

				'urlFormat' => 'path',

				'showScriptName' => false,

				'rules' => array(

					'admin'=>'site/index',

					'admin/<_c>'=>'<_c>',

					'admin/<_c>/<_a>'=>'<_c>/<_a>',

				),

			)

		)

    )



What could be wrong?

"admin/login" points to AdminController/actionLogin. I think you need "site/login" instead, if actionLogin belongs to SiteController.

The problem was I had ‘urlManager’ section in all free config files. It should be only in backend and frontend ones.

Is it possible to use gii with this direcotry structure?

I haven’t tried that. Why not? :)