Ignore first segments in ASP.NET MVC Core routing
问题 I'm looking for a route definition that is able to match routes like: /segment/xxxx/def /segment/.../xxxx/def /segment/that/can/span/xxxx/def and be able to run the action xxxx with param `def. But this kind of route isn't allowed: [Route("/{*segment}/xxx/{myparam}")] How can it be done? 回答1: You can use a custom IRouter combined with a regular expression to do advanced URL matching such as this. public class EndsWithRoute : IRouter { private readonly Regex urlPattern; private readonly string