在Google Chrome浏览器浏览器中自动将我的应用程序从HTTP重定向到HTTPS
问题描述:
我在web.config中添加了以下代码,用于将URL从HTTP转发到HTTPS。在Google Chrome浏览器浏览器中自动将我的应用程序从HTTP重定向到HTTPS
<rewrite xdt:Transform="Insert">
<rules>
<!-- Redirects users to HTTPS if they try to access with HTTP -->
<rule
name="Force HTTPS"
stopProcessing="true">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="^OFF$" ignoreCase="true"/>
</conditions>
<action
type="Redirect"
url="https://{HTTP_HOST}/{R:1}"
/> <!--redirectType="Permanent"-->
</rule>
</rules>
</rewrite>
它的做工精细,一段时间后,我删除了上述代码的web.config,但仍然每当我的应用我的本地机器上运行我的谷歌浏览器会自动重定向我的网址格式为:http到https。
你能告诉我如何解决上述问题吗?
Pradeep
答
Google Chrome缓存重定向。在更改Web配置后清除缓存或至少保持开发人员控制台在“网络”选项卡中选中的“禁用缓存”选项打开。
当“禁用缓存”它适用于我,但每当我清除缓存它将无法正常工作。 – pradeep
我知道,它很有趣。顺便说一句,我发现这个插件测试重定向有用:https://chrome.google.com/webstore/detail/redirect-path/aomidfkchockcldhbkggjokdkkebmdll –