IIS8 Default Document yields 404 not found error

我的未来我决定 提交于 2019-11-29 14:47:27

I think I have solved this problem. IIS 8 does not seem to respect the order of documents in the list of default documents and was always selecting default.aspx which was shown as the last document in the list.
My main application does not have a default.aspx page. When I removed all the entries in the list of default documents so that only the one and only document I needed for the main application was shown it worked correctly. This is a bit of a pain as my application has lots of sub-applications that use different landing pages. One of which uses default.aspx. We usually specified them all at the top level and used inheritance on the sub-applications, but now it seems each sub-application will need to be configured individually.

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.

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.

We can specify default document in web.config. Specify your default document in web.config and it should work.

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