Is there a default catch all fallback route in Play framework? If so how can I configure it in my routes file? Currently, there are some urls that I do not want the user to call them and even if they call, I don't want that error page appearing, rather I want them to go to the landing page of my web app! Is there a way to do that in the routes configuration file?
An explicit prefix-list (Match Prefix rule) assigned to a route map with the name “default-export” When used with the “Export Route Control Subnet” scope under the L3Out subnet, the route map will only match routes learned from dynamic routing protocols. It will not match BD subnets or directly-connected networks.
Enter a name for route control context, and choose the desired options for each field. To deny routes that match criteria that are defined in the match rule (which you will be choosing in the next step), select the action deny. The default action is permit . In the Match Rule field, choose the rule that was created earlier.
In the export and import route map, the set and match rules are grouped together along with the relative sequence across the groups (rtctrlCtxP). Additionally, under each group of match and set statements (rtctrlCtxP) the relation to one or more match profiles are available (rtctrlSubjP).
When used with the explicit route map configuration, the route map will match all routes, including BD subnets and directly-connected networks. Consider the following examples to get a better understanding of the expected and unexpected (inconsistent) behavior in the two situations described above.
Simply define a route matching any path at the end of your routes
file. Do not forget to define specific routes for your assets though, for example:
GET / controllers.Application.index
GET /some/path controllers.Application.someHandler
...
# End of file
GET /favicon.ico controllers.Assets.at(path="/public", file="img/favicon.ico")
GET /$file<(css|img|js|partials)/.*> controllers.Assets.at(path="/public", file)
GET /$path<.*> controllers.Application.catchall(path)
Any URL not matched by an earlier rule will be matched by this one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With