【发布时间】:2016-05-18 08:57:18
【问题描述】:
我有一个使用此域 http://abc.example.com/portal 的应用程序。 Portal 是 IIS 上主应用程序 (abc.example.com) 的子应用程序。
如果有人通过http://abc.example.com/portal 访问它,我想重定向到https://abc.example.com/portal。
我在 web.config 中添加了这些行:
<rewrite>
<rules>
<rule name="HTTPS Redirect" enabled="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
在此之后,如果我调用站点http://abc.example.com/portal,它会将我带到https://abc.example.com/,而不是https://abc.example.com/portal。
你们知道我该怎么做吗?
谢谢,
【问题讨论】: