Due to Sitecore’s peculiarities, it doesn’t support Attribute Routing out of the box, and using the MapMvcAttributeRoutes()  extension method in MVC is not recommended. Sitecore does support MVC Routing, though, and Sitecore’s documentation on MVC routing gave me something to work with to allow me to use Attribute Routing. As the documentation states, you need to inject a custom pipeline after Sitecore.Pipelines.Loader.EnsureAnonymousUsers. This placement ensures that we can still track logged in users in our attribute routes. Instead of adding each route manually as in the documentation, I use reflection to get all controllers from my assemblies, loop through all the methods in each controller, and check for the existence of MVC Route attributes. If the method has a route attribute I then create a new route using […] Read more