我需要重定向所有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