问题描述
在站点级别使用时,IIS7 URL Rewrite 2模块将其配置保存在该站点的web.config文件中。我正在使用Sitecore CMS,最佳做法是将任何web.config自定义存储在单独的配置文件中,以便于升级,登台/生产设置等。
When used at site level, the IIS7 URL Rewrite 2 module saves its configuration in the web.config file of that site. I'm using Sitecore CMS, and best practice is to store any web.config customisations in a separate config file for ease of upgrading, staging/production setups etc.
是有没有办法为IIS7重定向指定不同的配置文件?
Is there any way to specify a different config file for IIS7 redirects?
我知道应用程序级重写存储在ApplicationHost.config中,但我有几个站点正在运行服务器,并希望将它们分开。
I know that application-level rewrites are stored in ApplicationHost.config, but I have several sites running on the server and would like to keep them separated.
谢谢,Adam
推荐答案
你也可以尝试使用重写地图
You can also try to use rewrite maps
<rewrite>
<rewriteMaps configSource="rewriteMaps.config" />
</rewrite>
示例rewriteMaps.config文件:
Sample rewriteMaps.config file:
<rewriteMaps>
<rewriteMap name="CustomRewrites" defaultValue="">
<add key="/instructions" value="/documents" />
</rewriteMap>
</rewriteMaps>
这篇关于更改IIS URL重写配置位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!