How to redirect user to homepage in routes in laravel 4

I need to redirect the user to the home page if he goes to any page that is not found, that is, error 404

I saw this in Laravel Error Handling

But can this be done on routes?

Route::get('/', 'MainController@MainPage');

above is my home route

+4
source share
1 answer

If you need to do this on your routes, you should have it at the top of your routes.

App::missing(function($exception)
{
    return Redirect::to('/');
});
+6
source

All Articles