After a successful login, I was going to about the page. This is normal.
But the URL does not change on the About page. This is the same as the login page, but the content of the page is the page.
SiteController.php
public function actionLogin()
{
if (!\Yii::$app->user->isGuest)
{
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()))
{
return $this->render('about');
}
return $this->render('login', [
'model' => $model,
]);
}
The url is the same as http://localhost/myProject/yii/web/index.php?r=site%2Flogin
. It should behttp://localhost/mylawsuit/yii/web/index.php?r=site%2Fabout
So how to change the url after login.? Thanks in advance.
source
share