咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

使用程序强制跳转到HTTPS

2017-11-16 18:28:55 11206次

兼容:


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;

}


首页
最新活动
个人中心