ASP.NET Web API returns 404 for PUT only on some servers

Solution 1:

For those of you who do not have WebDAV enabled but are still running into this issue using MVC 4's Web API's...

Steve Michelotti documented a solution that worked for me here.

At the end of the day, I enabled all verbs (verb="*") to the ExtensionlessUrlHandler-Integrated-4.0 handler in my web config.

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
        <handlers>
            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
</system.webServer>

Solution 2:

Those IIS servers have web-dav module installed on them and i bet it is not needed and it was installed because the person installing ticked all boxes.

Just remove web-dav from iis.

Alternatively use web.config to remove web dav module:

<system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>
    ...