IIS 7 Not Serving Default Document

穿精又带淫゛_ 提交于 2019-11-28 06:25:26
Aaron Jensen

It looks like Microsoft released an update that enables the ExtensionlessURL HTTP handler to work with extensionless URLs. Unfortunately, this breaks certain other handlers. In my case, the DefaultDocument handler under classic app pools. The solution is to remove the ExtensionlessURL handlers in our application's web.config:

<system.webServer>
  <handlers>
    <remove name="ExtensionlessUrl-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrl-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrl-Integrated-4.0" />
  </handlers>
</system.webServer>

I solved the problem with putting the "StaticFile" handler in HandlerMapping in front of "ExtensionlessUrlHandler-*"

I noticed when removing the managed .NET framework (4.0) from the application pool, it fixed the problem for me too!

We don't use .NET at all in our IIS environment!

Changing the StaticFile order helped to fix the issue, when setting default document to a web site application in IIS, while the root website also had another default document.

Adding the DefaultDocument component to IIS in add/remove windows features and then inserting the name of my default script ( index.php) worked for me.

I use the following rule in web.config URL Redirect as workaround to solve this:

 <system.webServer>
    <rewrite>
      <rules>
        <rule name="Default document rewrite" stopProcessing="true">
          <match url="^(.+/)?$" />
          <action type="Redirect" url="https://{HTTP_HOST}/default.aspx" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!