I redirect my users to the controller/action
video/player
when they login successfully. And it works fine.
But after someone logs in, I want to direct them to
video/player
by default also if there is no specific controller/action in the URL.
I thought this would work; here is my ‘site/index’
public function actionIndex()
{
if (Yii::app()->user->isGuest)
{
$this->render('index');
} else {
$this->redirect(Yii::app()->createUrl('video/player'));
}
}
The first part works fine, if they are not logged in they are shown the ‘index’ view. But if they are already logged in it keeps reloading the ‘video/player’ on an infinite loop. Any ideas?