IIS 7不提供默认文档 [英] IIS 7 Not Serving Default Document

查看:264
本文介绍了IIS 7不提供默认文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的某些开发人员工作站上发生了一个问题:当访问没有文件名的URL时(例如 http://localhost /),则IIS 7将返回404错误.每个人都在运行Windows 7/IIS 7.5和ASP.NET 4.0.应用程序池配置为使用经典管道模式.

We have a problem occuring on some of our developer workstations: when visiting a URL without a filename (e.g. http://localhost/), IIS 7 returns a 404 error. Everyone is running Windows 7/IIS 7.5 and ASP.NET 4.0. The application pool is configured to use Classic pipeline mode.

启用默认文档,并且default.aspx在默认文档列表中.

Default documents are enabled, and default.aspx is in the default document list.

我启用了失败的请求跟踪,并在日志中看到了这一点:

I enabled failed request tracing, and see this in the log:

OldHandlerName="", NewHandlerName="ExtensionlessUrl-ISAPI-4.0_64bit", 
  NewHandlerModules="IsapiModule", 
  NewHandlerScriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll", NewHandlerType=""

稍后,我看到此IsapiModule拒绝了该请求:

Later on, I see that this IsapiModule is rejecting the request:

ModuleName="IsapiModule", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="404",
  HttpReason="Not Found", HttpSubStatus="0", 
  ErrorCode="The operation completed successfully. (0x0)", ConfigExceptionInfo="" 

看来 IIS认为ExtensionlessUrl-ISAPI-4.0-64bit应该正在处理请求.当我查看该模块的配置时,它表明它应该与路径*.匹配,所以我很困惑为什么它与任何路径都不匹配.

It looks like IIS thinks the ExtensionlessUrl-ISAPI-4.0-64bit should be handling the request. When I look at that module's configuration, it shows that it should be matching path *., so I'm confused why it is matching no path.

Google搜索显示此帖子在IIS.net论坛上从2005年开始出现.不幸的是,没有提供解决方案,只是对问题的肯定.

A Google search turns up this post on the IIS.net forums from 2005. Unfortunately, no solutions are offered, just an acknowledgement of the problem.

当我将应用程序池更新为使用集成模式时,问题就消失了.不幸的是,它必须在经典模式下运行.

When I update my app pool to use integrated mode, the problem goes away. Unfortunately, it has to run in Classic mode.

我该怎么做才能使IIS重新存储我们的默认文档?

推荐答案

Microsoft似乎发布了允许ExtensionlessURL HTTP处理程序与无扩展URL一起使用.不幸的是,这破坏了某些其他处理程序.就我而言,是经典应用程序池下的DefaultDocument处理程序.解决方案是在我们应用程序的web.config中删除ExtensionlessURL处理程序:

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>

这篇关于IIS 7不提供默认文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆