Redirecting to a specific Page


I would like to rephrase my problem.

I have an admin.php in protected folder…

It just shows a different output in the homepage.

My goal is, after I login, I would like to redirect it to admin.php…

I think that I would change this code(BOLDed and colored red) in site/login:

public function actionLogin()


	$model=new LoginForm;

	// if it is ajax validation request

	if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')


		echo CActiveForm::validate($model);



	// collect user input data




		// validate user input and redirect to the previous page if valid

		if($model->validate() && $model->login())

			[color="#FF0000"][b] $this->redirect(Yii::app()->homeUrl);[/b][/color]


	// display the login form




What do I change their, in order for it to redirect to admin.php?


$this->redirect(array('controllerName/actionName'));  // you must have specified controller to rander admin page



you can use


this should do it

Greetings Shiran and Alirz

Yup. Thnx to both of you… :) That was the code I was looking for. :)