Frage

I want to configure a wildcard mapping for a specific path, and send the requests to a HttpHandler. My URLs look like this:

This configuration doesnt match the URLs above.

<location path="api/v1/conversation">
    <system.webServer>
        <handlers>
            <add name="ApiProxy" verb="*" path="*" preCondition="integratedMode" type="DemoProject.ApiProxy, DemoProject" />
        </handlers>
    </system.webServer>
</location>

It works when I add an extension to my URLs:

How do I make this work extension-less?

War es hilfreich?

Lösung

It turned out, that this problem was related to my website was running Umbraco CMS. Umbraco CMS has an AppSetting called "umbracoReservedPaths", which asks Umbraco to ignore specific paths.

The value was set to:

<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />

After adding ~/api/, everything worked as expected:

<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/api/" />
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top