There seem to be limitations.
routes.MapRoute( _ "ViewFile", "BasePath/{*RestOfPath}", _ New With {.controller = "File", .action = "DownloadFile"}, _ New With {.RestOfPath = ".*\.zip"} ) routes.MapRoute( _ "ViewFolder", "BasePath/{*RestOfPath}", _ New With {.controller = "Folder", .action = "ViewFolder"} _ )
or for those of you who prefer C # ...
routes.MapRoute( "ViewFile", "BasePath/{*RestOfPath}", new {controller = "File", action = "DownloadFile"}, new {RestOfPath = @".*\.zip"} ); routes.MapRoute( "ViewFolder", "BasePath/{*RestOfPath}", new {controller = "Folder", action = "ViewFolder"} );
(I think it is right)
The same route is registered twice, while the first option gives an additional restriction, which the RestOfPath parameter must end with ".zip"
I was given to understand that Custom Constraints are also possible using derivatives from IRouteConstraint.
source share