Yii Framework Forum: Invalid redirection problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Invalid redirection problem Rate Topic: -----

#1 User is offline   mazu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 06-September 10

Posted 06 September 2010 - 04:36 PM

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?
0

#2 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 07 September 2010 - 05:22 AM

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

#3 User is offline   mazu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 06-September 10

Posted 08 September 2010 - 02:21 PM

View Postandy_s, on 07 September 2010 - 05:22 AM, said:

"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?
0

#4 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 08 September 2010 - 03:03 PM

View Postmazu, on 08 September 2010 - 02:21 PM, said:

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? :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users