使用程序強制跳轉(zhuǎn)到HTTPS

          兼容:

          <!-- 如果檢測到是http頁面,則自動跳轉(zhuǎn)到對應的https頁面 -->
          <script type="text/javascript">
          if (document.location.protocol != "https:") { 
                  location.href = location.href.replace(/^http:/,"https:");
          }
          </script>



          ASP:

          <%
          If Request.ServerVariables("SERVER_PORT")=80 Then
          Dim strSecureURL
          strSecureURL = "https://"
          strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
          strSecureURL = strSecureURL & Request.ServerVariables("URL")
          Response.Redirect strSecureURL
          End If
          %>

           

          PHP:

          if(!isset($_SERVER['HTTPS'])||!$_SERVER['HTTPS']){
          $url ='https://'. $_SERVER['HTTP_HOST']. $_SERVER['REQUEST_URI'];
          header('Location: '. $url);exit;
          }


          亚洲日韩一区精品,97美女国产超碰精品,亚洲中文自拍另类片,国产操逼视频免费看