不同的默认文档对于IIS子应用 [英] Different Default Document for IIS Sub Application
问题描述
我有一个IIS网站运行ASP.NET网站,但它有其下运行多个应用程序。
I have an IIS website running an ASP.NET site but it has multiple applications running under it (a virtual directory with separate app pools basically).
好 - 我需要它指向相同的根文件夹主任两个独立的应用程序,但我想要的应用程序有不同的默认文档。究其原因是因为这是它是如何在生产配置,这是对我的发展框。
Well - I need two separate applications which point to the same root folder director but I want the apps to have separate default documents. The reason is because this is how it is configured in production and this is on my development box.
问题是,IIS一直给我两个应用程序(它们是独立的虚拟路径和单独的应用程序池只是同一物理位置)相同的默认文档。我怎么不能在IIS7克服这个还是可以吗?
The problem is that IIS keeps giving me the SAME default document for both apps (which are separate virtual paths and separate app pools just same physical location). How can I overcome this or can I not in IIS7?
我要重新写了整个事情,它不会做这种方式在未来编...但在那之前,我需要修复一些bug,并希望当地的开发环境。救命啊!
I am going to be re-writing the whole thing and it will not be done this way in the furture...but until then I need to fix some bugs and want a local dev environment. Help!
推荐答案
为了实现这一点,preserve在我们的网站实施的设置,我需要在根站点添加System.WebServer元件的周围的位置标记web.config中,并在那里指定默认文件如下,其中的路径是VirtualDirectory /应用程序名称:
In order to accomplish this and preserve the setup implemented in our sites I needed to add a location tag around the System.WebServer element in the root site web.config and specify the default document in there as follows where the path is the VirtualDirectory/Application name:
<location path="VirtualDirectoryName">
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Document.asp" />
</files>
</defaultDocument>
</system.webServer>
</location>
<location path="VirtualDirectoryName2">
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="AnotherDocument.asp" />
</files>
</defaultDocument>
</system.webServer>
</location>
这篇关于不同的默认文档对于IIS子应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!