I am working on a .NET MVC application and am trying to write a route in global.asax.cs. The goal is, I want any URL that contains an uppercase character to run through said route. The idea is, the router will lowercase the URL and redirect it. My approach is to use a regular expression to handle this. Here's what I have:
routes.MapRoute(
"CanonicalizationRoute",
"{*url}",
new
{
controller = "CanonicalRouter",
action = "Reroute"
},
new
{
url = @"[A-Z]+"
});
Doesn't seem to do the trick...any thoughts on how best to handle this?