【问题标题】:IIS 7.5 Not serving Default Document in Integrated pipeline mode?IIS 7.5 不在集成管道模式下提供默认文档?
【发布时间】:2013-08-01 10:04:56
【问题描述】:

更改前:

我的网站 local.Mywebsite.com 托管在我的本地 IIS 7.5 中。该网站在 .net 版本 4.0 中运行,并且 IIS 应用程序池处于 集成管道模式。它工作得很好。

我可以将 local.Mywebsite.com/default.aspx 浏览为 local.Mywebsite.com 这意味着 IIS 按照我的配置提供默认文档。

变化:

我需要将另一个应用程序 Foo 作为虚拟目录添加到我的网站中。我添加了它,并且能够浏览和使用与 local.Mywebsite.com 相同的完整路径/Foo/Mypage.aspx.

然后我为我的 Foo 虚拟目录配置了一个默认文档。

我的问题:

我尝试浏览到 local.Mywebsite.com/Foo/

我遇到了一个错误:

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies)
could have been removed, had its name changed, or is temporarily unavailable.  
Please review the following URL and make sure that it is spelled correctly. 

现在 IIS 不为我的 Foo 虚拟目录提供默认文档。

但仍然可以浏览 local.Mywebsite.com,IIS 在此处提供默认文档。

任何人有任何想法或任何建议都非常感谢。

更新:

当我重命名文件 Mypage.aspxDefault.aspx 时,IIS 可以很好地提供默认文件。我可以通过浏览 local.Mywebsite.com/Foo/ 看到 default.aspx 页面。

我的网络配置:

<defaultDocument enabled="true">
  <files>
    <clear/>
    <add value="Mypage.aspx" />
  </files>
</defaultDocument>

【问题讨论】:

  • 我也检查过这个stackoverflow.com/questions/6948669/…,但这是给classical pipeline mode
  • 你能发布/Foo的相关web.config部分吗?
  • 另外,您还使用了 default.aspx 的两个错误拼写:deafualt.aspxdefualt.aspx,这些只是您的问题中的错字吗?
  • @Kev 感谢时间拼写在我的问题中得到纠正,这不是问题。您期待哪个配置部分?
  • 您的拼写仍然有误 :) defualt.aspx -> default.aspx。默认的文档配置部分是我正在寻找的。​​span>

标签: asp.net .net-4.0 iis-7.5 virtual-directory integrated-pipeline-mode


【解决方案1】:

当您在机器上以调试模式运行应用程序时,它会出现 404 错误。

1.请在您的 web.config 中验证您是否具有以下设置

<authentication mode="Windows"/>

  <identity impersonate="true"/>

  <authorization>

  <allow users="*"/>

</authorization>

我之前也遇到过类似的问题,加&lt;identity impersonate="true"/&gt;解决了。

2.确保您在 IIS 中选择了正确版本的 .NET(在您的情况下为 .NET 4.0)
3.如果您没有在 Web 项目的属性下设置起始页,也会发生这种情况
4.尝试清除您的浏览数据。尤其是当您使用 IE 时。

如果错误仍然显示,请在 web.config 中关闭自定义错误模式,以便您了解真正的问题出在哪里 你可以解决它。 :)

【讨论】:

  • 这不会解决我的问题。我正在使用form authentication。我已经检查了你在这里提到的所有东西。感谢您的宝贵时间;)
猜你喜欢
  • 2010-10-10
  • 1970-01-01
  • 2012-05-07
  • 2011-06-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多