【发布时间】:2011-10-14 18:17:12
【问题描述】:
我们使用 IIS7 URL 重写模块和 asp.net C#,所有的 URL 都被配置并直接写入 web.config:
<system.webServer>
<!-- ... -->
<rewrite>
<rules>
<clear />
<rule name="Category URL" stopProcessing="true">
<match url="somepage.aspx" ignoreCase="false"/>
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{QUERY_STRING}" pattern="REDIRECTION=true"
ignoreCase="false"/>
<add input="{QUERY_STRING}" pattern="categoryid=([^&]*)"/>
</conditions>
<action type="Redirect" url="http://{HTTP_HOST}/browsing/categorylanding.aspx?navcategoryid={C:1}"/>
</rule>
</rules>
</rewrite>
</system.webServer>
我需要将其移至一个部分,以便我可以为 QA、DEV 和生产制定单独的规则,我将在该部分中定义的“类型”是什么?
<configSections>
<section name="IISURLRewriteSection" type="???"/>
</configSections>
一旦将这些设置从 web.config 移到另一个自定义配置文件中,IIS 会自动获取这些设置吗?
【问题讨论】:
-
似乎没有人真正回答这个问题