Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If No route match then redirect to root page

If I enter wrong route or if no routes match error comes then I want to redirect to root_path. How can I do this?

Thank In Advance

like image 346
Dipak Panchal Avatar asked Dec 31 '12 10:12

Dipak Panchal


1 Answers

Create the file in 'public/404.html' and redirect to, if path not found:

get '*path' => redirect('/404.html')
like image 165
Darlan D. Avatar answered Oct 13 '22 08:10

Darlan D.