I’ve got a simple Rails application running as a splash page for a website that’s going through a transition to a new server. Since this is an established website, I’m seeing user requests hitting pages that don’t exist in the Rails application.
How can I redirect all unknown requests to the homepage instead of throwing a routing error?
I just used route globbing to achieve this:
Note that this route should be at the end of routes.rb so that all other routes are matched before it.