php - YII2 redirect causes blank page -
is there server/hosting setting cause simple redirect in yii2 not work?
for example:
function actionindex(){ return $this->redirect('other-page'); }
this code ends blank page, no errors or messages displayed(error reporting on), response code 200 (altough yii2 debugger shows 302). on website works fine code reaches ->redirect() end blank page. happens on clients shared hosting(on local machine , development shared hosting works fine). yii2 runtime logs not show errors, neither server logs hosting giving me access to.
it turned out standard white page error: additional new blank line @ beginning of php file. went through framework files, line line. when commented out if(headers_sent()) {return;} yii threw exception, let me find out 1 of config files had new line @ beginning of file. removing fixed problem.
Comments
Post a Comment