limiting redirects to 404s
parent
840ca668a9
commit
a4825200a4
|
@ -30,14 +30,10 @@
|
|||
$app->mount( '/events', new level2\EventsControllerProvider() );
|
||||
|
||||
$app->error(function (\Exception $e, $code) use ( $app ) {
|
||||
switch ($code) {
|
||||
case 404:
|
||||
if ( $code == 404 ) {
|
||||
return $app->redirect('/');
|
||||
default:
|
||||
$message = 'We are sorry, but something went terribly wrong.';
|
||||
}
|
||||
|
||||
return new Response($message);
|
||||
}
|
||||
});
|
||||
|
||||
return $app;
|
||||
|
|
Loading…
Reference in New Issue