IIS8默认文档产生404找不到错误 [英] IIS8 Default Document yields 404 not found error

查看:258
本文介绍了IIS8默认文档产生404找不到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台带有IIS 8的新Windows Server 2012计算机. 我已经安装了将Windows身份验证用于登录页面的应用程序. 该应用程序使用.NET 2.0(配置有些麻烦,但这是另一回事) 如果您在URL中指定登录页面,则该应用程序将完美运行. 该登录页面是应用程序的默认文档,该文档将验证用户并在用户注册后自动登录.如果未注册,则会将其重定向到Forms身份验证登录页面,在此页面中,他们可以输入本地应用程序凭据.

I have a new Windows Server 2012 machine with IIS 8. I have installed an application that uses Windows Authentication for the login page. The application uses .NET 2.0 (which was a bit of a pain to configure, but that is a different story) The application works perfectly if you specify the login page in the URL. This login page is the default document for the application which verifies the user and logs them in automatically if they are registered. If they are not registered then it redirects them to a Forms authentication login page where they can enter local application credentials.

我遇到的问题是,仅当您直接浏览到登录页面(即E.E.)时,该登录页面才有效.在URL中输入名称.如果您使用IIs中的默认文档,它将返回404错误.

The problem I have is that the login page only works when you browse to it directly I.E. type the name in the URL. If you use the Default document from IIs it returns a 404 error.

我在这里看到了其他有关IIS 7或IIS 7.5的文章,这些文章表面上看起来与IIS 8相同,但是这些问题的解决方案不能解决我的问题.

I have seen other articles here which are for IIS 7 or IIS 7.5 which appear on the surface to be the same as IIS 8 but the solutions for those problems do not resolve my problem.

应用程序池当前配置为Classic(还尝试了Integrated),并使用NetworkService作为应用程序帐户并启用了32位.它是为.NET Framework v2.0配置的.站点和应用程序虚拟目录均启用了默认文档.

The application pool is currently configured as Classic (have also tried Integrated) and uses NetworkService as the application Account and has 32 bit enabled. It is configured for .NET Framework v2.0. Default documents are enabled for both the site and the application virtual directory.

推荐答案

这使我对自己的情况有了答案.确实,更改默认文档的顺序后,将index.html移到列表的顶部后,我的index.html才能正常工作.我不需要进一步截断列表.

This led me to an answer for my situation. Indeed changing the order of the default documents got my index.html working after I moved it to the top of the list. I did not need to truncate the list any further.

但是,出现此错误的原因是我以前在顶部具有index.aspx,并且在网站中确实有一个index.aspx文件.但是事实证明,服务器上尚未安装ASP.Net.因此,当服务器本应忽略它并进入我的测试index.html文件,或者给我一些消息,表明它无法读取.aspx文件时,该服务器在index.aspx(实际上存在)上返回了一个非常令人误解的404错误.

However, the reason I was getting the error is I previously had index.aspx at the top and I did indeed have an index.aspx file in the website. But it turns out ASP.Net was not yet installed on the server. So the server returned a very misleading 404 error on the index.aspx (which was actually there) when it should have either ignored it and gone onto my test index.html file, or given me some message that it could not read .aspx file.

这篇关于IIS8默认文档产生404找不到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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