0

我在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

回答

1

Google Chrome緩存重定向。在更改Web配置後清除緩存或至少保持開發人員控制檯在「網絡」選項卡中選中的「禁用緩存」選項打開。

+0

當「禁用緩存」它適用於我,但每當我清除緩存它將無法正常工作。 – pradeep

+0

我知道,它很有趣。順便說一句,我發現這個插件測試重定向有用:https://chrome.google.com/webstore/detail/redirect-path/aomidfkchockcldhbkggjokdkkebmdll –

相關問題