久久青草精品A片狠狠,日韩欧美视频一区二区,亚洲国码AV日韩,国产精品黄在

IIS7下站點實現從http跳轉https

2018-04-13 17:43:27 16430

若一個站點同時可通過http和https訪問,但需要實現點擊http跳轉https的效果,該如何實現?

答案是在Web.config添加以下代碼實現http跳轉到https:

<system.webServer>
   <rewrite>
     <rules>
       <rule name="HTTP to HTTPS redirect" stopProcessing="true">
         <match url="(.*)" />
         <conditions>
           <add input="{HTTPS}" pattern="off" ignoreCase="true" />
         </conditions>
         <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
       </rule>
     </rules>
   </rewrite>
 </system.webServer>
注意:若Web.config已有內容,則在配置文件web.config中添加<rewrite>到</rewrite>部分即可



提交成功!非常感謝您的反饋,我們會繼續努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務,我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: