If No route match then redirect to root page
Make this statement the last in your config/routes.rb
file:
match "*path" => redirect("/")
The "*path"
will match anything and will redirect to the root path.
For more info, take a look at route globbing and redirection in the official Rails guides.
In Rails 4/5 you can
get '*path' => redirect('/')
Edit. As pointed out by @VenkatK this should be last route. The way routes ere evaluated is that those on top are more important than those on the bottom.