關於虛擬目錄繼承根Web.Config的問題解決辦法

虛擬目錄中的web.config繼承了主目錄中的web.config大部分主要是由於根目錄中的web.config添加了httphandler、 httpmodule 引起的。

只將 httphandler httpmodule的聲明添加到location中即可。

如下所示: 

<location path="." allowOverride="true" inheritInChildApplications="false"> 
<system.web>     
<httpModules>      
<add name="UrlRewriteModule"   type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</httpModules> 
</system.web> 
</location>

path 不用說指定的是一個目錄 allowOverride 指是否可以將這個重寫 inheritInChildApplications 指是否被子級應用程序繼承。

發佈了39 篇原創文章 · 獲贊 8 · 訪問量 14萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章