IIS 重写规则并返回到非安全 http: 之后
我获得了 https 重写规则的副本,以便当 url 中包含某些关键字时,它会自动重定向到特定端口上的 https: 。
然而,我还想要一些东西,当我想注销安全区域并返回到非 ssl 站点时,它不再位于 https 上。我在这方面一直没有成功。
有人可以告诉我我需要做什么吗? 这是我使用的 https 规则。
<rewrite>
<rules>
<rule name="Secure Account Controller" enabled="true" stopProcessing="true">
<match url="^account" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" >
<add input="{HTTPS}" pattern="off"/>
<add input="{HTTP_HOST}" pattern="([^/:]*?):[^/]*?" />
</conditions>
<action type="Redirect" url="https://{C:1}:44300{URL}"/>
</rule>
</rules>
</rewrite>
** 更新 ** 这似乎已经完成了..不知道为什么浏览器中的网址一旦完成就不会恢复..但是当我单击网站中的另一个页面时...它显示http
<rule name="Home Controller" enabled="true" stopProcessing="true">
<match url="^home" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" >
<add input="{HTTPS}" pattern="on"/>
<add input="{HTTP_HOST}" pattern="([^/:]*?):[^/]*?" />
</conditions>
<action type="Redirect" url="http://{C:1}:7224{URL}"/>
</rule>
I got a copy of an https rewrite rule so that when certain keywords are in the url it automatically redirects to an https: on a specific port.
However, I would also like something that when I want to logout of the secure area and go back to the non ssl site that it's no longer on https. I have been unsucessful in doing this.
Can someone tell me what I need to do?
Here's the https rule I used.
<rewrite>
<rules>
<rule name="Secure Account Controller" enabled="true" stopProcessing="true">
<match url="^account" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" >
<add input="{HTTPS}" pattern="off"/>
<add input="{HTTP_HOST}" pattern="([^/:]*?):[^/]*?" />
</conditions>
<action type="Redirect" url="https://{C:1}:44300{URL}"/>
</rule>
</rules>
</rewrite>
** UPDATED **
This seems to have done it.. Not sure why the url in the browswer doesn't revert once it's finished.. but when I click on another page in the site... it's showing http
<rule name="Home Controller" enabled="true" stopProcessing="true">
<match url="^home" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" >
<add input="{HTTPS}" pattern="on"/>
<add input="{HTTP_HOST}" pattern="([^/:]*?):[^/]*?" />
</conditions>
<action type="Redirect" url="http://{C:1}:7224{URL}"/>
</rule>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已更新 ** 这似乎已经完成了.. 不知道为什么浏览器中的网址在完成后不会恢复.. 但是当我单击网站中的另一个页面时... 它显示 http
UPDATED ** This seems to have done it.. Not sure why the url in the browser doesn't revert once it's finished.. but when I click on another page in the site... it's showing http