Skip to content

Instantly share code, notes, and snippets.

@dominicmartineau
Last active December 19, 2015 12:48
Show Gist options
  • Save dominicmartineau/5957140 to your computer and use it in GitHub Desktop.
Save dominicmartineau/5957140 to your computer and use it in GitHub Desktop.
Laravel 4: How to redirect to 404 page after exception thrown. Simply add a redirect to your 404 page at the end of 'App::error()' into app/start/global.php. You should return to your 404 page only if debug is not enabled.
App::error(function(Exception $exception, $code)
{
Log::error($exception);
if (Config::get('app.debug') == false) {
return Redirect::route('404');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment