我需要重定向所有HTTPS请求的HTTP,例如,如果有人访问https://www.example.com/another-page/到http://www.example.com/another-page/IIS重写规则在web.config中重定向HTTPS请求HTTP
我在我的web.config以下重写规则现在,但它不能正常工作。它正在将https://www.example.com/another-page/重定向到https://www.example.com/,所以到站点的根目录,而是我希望重定向保留在同一个URL中,并且只将http重写为http。
<rule name="Redirect to HTTP" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{R:1}" pattern="^onepage/(.*)$" negate="true" />
<add input="{HTTPS}" pattern="^ON$" />
</conditions>
<action type="Redirect" url="http://{HTTP_HOST}/{R:0}" redirectType="Permanent" />
</rule>
任何有关更改上述规则的帮助,以便它只将https更改为http,但保留完整的url访问将不胜感激!
非常相关,虽然这个问题在技术上不是一个笨蛋:http://stackoverflow.com/questions/9823010/how-to-force-https-using-a-web-config-file – 2015-08-04 20:30:20