I’d like to have a route setup like the following
routes.MapRoute(
"Static content handler",
"content/{name}.{type}",
new { controller = "StaticHandler", action = "StaticContent" });
But I’d like to also route scripts/{name}.{type} to the same controller and action and I’d rather not add another routing method if I can get away with it.
Can I set it up with something like (content|scripts)/{name}.{type}?
You probably want to use a RoutingConstraint
That last
new {}will use the regex to tell the router that only use this route if folder is “scripts” or “content”