Extensionsless URLs (with ExtensionlessUrlHandler-Integrated-4.0) are working fine in my MVC 4 app, except for paths with dots in them, e.g.
/tags works fine
/tags/.net does not work
To make the second URL work I have to either set runAllManagedModulesForAllRequests="true" or remove the managedHandler precondition on the UrlRoutingModule-4.0 module and any other module that needs to run for that URL, which means I'm back to square one and all those modules will run for static requests (right?).
Is there a way to use the Extensionsless URLs with dots in the path?
Change the path attribute to star, as in path="*"
In my case when I added a copy of the handler with the specific extension that I wanted to be handled it worked fine:
<add name="ExtensionlessUrl-Integrated-4.0-webdav-xml" path="*.xml" verb="PUT" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />
This handled a situation where I needed to allow file uploads to a WCF service using the PUT verb.
If you need to handle multiple extensions you could try setting the handler's path to * instead of *.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With