我无法弄清楚如何让我的web.config部署转换适用于重写规则。我试过以下,它忽略它。使用vs2012 web部署更新url重写规则web.config转换
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<rewrite xdt:Transform="Replace">
<rules>
<rule name="Force HTTPS On Login/Register" stopProcessing="true">
<match url="Account/Login(.*)|Register(.*)" ignoreCase="true" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Force HTTPS Off" stopProcessing="true">
<match url="((Account/Login(.*))|(Register(.*)))" negate="true" ignoreCase="true" />
<conditions>
<add input="{HTTPS}" pattern="^ON$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
按照您的建议工作。到目前为止,我还没有使用slowcheetah。我一直听到它,但只是恨不断增加我的依赖。 – 2013-05-02 18:17:19