Reputation: 2601
In addition to all the defined api routes, I want to handle any other url in a LegacyUriRedirect action.
I have tried to leave the routeTemplate empty, but it catches only the root url and ignores any urls with segments.
How do I change the below code so that it catches all urls with any segments?
config.Routes.MapHttpRoute(
name: "LegacyUriRedirect",
routeTemplate: "",
defaults: new { controller = "URI", action = "LegacyUriRedirect" }
);
Upvotes: 4
Views: 1552
Reputation: 2601
config.Routes.MapHttpRoute(
name: "LegacyUriRedirect",
routeTemplate: "{*catchall}",
defaults: new { controller = "URI", action = "LegacyUriRedirect" }
);
Upvotes: 5