In the route registration, you can add a โcatchingโ route after your other routes, so if the route does not match the current request, you can redirect it to a specific controller / action
From another answer in stack overflow:
routes.MapRoute("Error", "{*url}",
new { controller = "Error", action = "404" }
);
source
share