使用程序強(qiáng)制跳轉(zhuǎn)到HTTPS
2017-11-16 18:28:55
16047
兼容:
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;
}
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)