You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My custom notFoundHandler works in 3.8.1 but not in 3.9.x. Now I just get the browser error. The redirect line doesn't work. Any idea on what changed and how I can fix it?
//Override the default Not Found Handler
'notFoundHandler' => function ($container) {
return function ($request, $response) use ($container) {
return $container['response']
->withStatus(404)
->withHeader('Content-Type', 'text/html')
->withRedirect($container->router->pathFor('pageNotFound'));
};
}
The text was updated successfully, but these errors were encountered:
Ok, thanks.
It works when I remove the status and header lines and simply redirect:
//Override the default Not Found Handler
'notFoundHandler' => function ($container) {
return function ($request, $response) use ($container) {
return $container['response']
->withRedirect($container->router->pathFor('pageNotFound'));
};
}
My custom notFoundHandler works in 3.8.1 but not in 3.9.x. Now I just get the browser error. The redirect line doesn't work. Any idea on what changed and how I can fix it?
The text was updated successfully, but these errors were encountered: