国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

幫助中心 >  技術(shù)知識(shí)庫 >  云服務(wù)器 >  IIS的使用和管理 >  IIS7下站點(diǎn)實(shí)現(xiàn)從http跳轉(zhuǎn)https

IIS7下站點(diǎn)實(shí)現(xiàn)從http跳轉(zhuǎn)https

2018-04-13 17:43:27 11211

若一個(gè)站點(diǎn)同時(shí)可通過http和https訪問,但需要實(shí)現(xiàn)點(diǎn)擊http跳轉(zhuǎn)https的效果,該如何實(shí)現(xiàn)?

答案是在Web.config添加以下代碼實(shí)現(xiàn)http跳轉(zhuǎn)到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已有內(nèi)容,則在配置文件web.config中添加<rewrite>到</rewrite>部分即可



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

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

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

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