I want to custom unmatched 404 page, I specified the "template" parameter as "{*}" in router "all", aiming to catch all urls (such as "http://localhost:12345/aaa/bbb/ccc/ddd/") that are not matching to the "default" router. Is there any way to do so?
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{Controller:regex((?i)^((?!Error).)*$)}/{Action}/{id?}",
defaults: new { Controller = "Home", Action = "Index" })
//TODO: This Route is not working as expected.
.MapRoute(
name: "all",
template: "{*}", //<---------
defaults: new { Controllers = "Error", Action = "Unknown" });
});