存档

文章标签 ‘web.config’

让web.config不继承父目录

2009年1月10日 没有评论

利用配置文件的配置节可以让它不继承父目录的配置文件,如下

<location path=”.” allowOverride=”false” inheritInChildApplications=”false”> </location>

把它加在父目录的<system.web>节外面即可,测试一下果然如此,甚喜,虽记之以备忘,同时也于大伙共享!

下面是更好的一个:

虚拟目录中的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>

阅读全文…

分类: web 标签: