Web API 2 hosted in IIS 7.5 and Windows server 2008 R2 giving 403.14

♀尐吖头ヾ 提交于 2019-12-11 01:40:14

问题


There are many other questions similar to this in SO, i am still posting here because none of them are working out for my environment.

The exact error i am getting is,

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

Enabling Directory browsing in IIS doesn't help at all.

Also tried adding adding all verbs in ExtensionLessUrlHandler-Integrated-4.0 in IIS Handler mappings.

And also tried removing module WebDAVModule and WebDAV handler in config as shown below.

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

Thanks in advance for your answers!


回答1:


If anyone is still facing this issue, I got it resolved by adding the lines below in my config file:

<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>


来源:https://stackoverflow.com/questions/23306788/web-api-2-hosted-in-iis-7-5-and-windows-server-2008-r2-giving-403-14

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!