【发布时间】:2014-04-15 06:46:54
【问题描述】:
我正在尝试通过包含路径的 URL 的 web.config URL 重写规则强制使用 HTTPS。
例如http://my.domain.com/folder必须强制使用https://my.domain.com/folder
我还想在其相对路径上强制所有页面使用 HTTPS
例如 http://my.domain.com/folder/page.aspx 强制 https://my.domain.com/folder/page.aspx
这就是我所拥有的:
<rewrite>
<rules>
<rule name="Redirect to https">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="Off"/>
<add input=”{REQUEST_METHOD}” pattern=”^get$|^head$” />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}"/>
</rule>
</rules>
</rewrite>
【问题讨论】:
标签: iis azure url-rewriting web-config