S
S
Stepan2015-01-24 02:14:15
Yii
Stepan, 2015-01-24 02:14:15

Did redirect() stop working in Yii2 after site migration?

Moved the site from work to home via git. Made the base connected. Error 400 when creating posts
Found out that tokens should be banned. Forbidden through beforeAction in the controller. The error is gone.
But now after creating the form, there is another problem. The redirect does not work and the user is not redirected anywhere, but remains on the same empty page

return $this->redirect(['view', 'id' => $model->id]);

Actually in the controller did not change anything. What could be the problem? I think this is related to these tokens, with the update via composer.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Semenko, 2015-01-25
@abler98

Try this option

return Yii::$app->response->redirect(['view', 'id' => $model->id]);

Максим Тимофеев, 2016-09-18
@webinar Куратор тега Yii

При чем тут токены? Если они работали на другом сервере - и тут должны.
Очистите кеш (в папке runtime и проверьте что бы скрипт мог туда писать), очистите папку assets, проверьте конфиг.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question