技术文档

使用程序强制跳转到HTTPS – HTTPS SSL 教程

 

使用程序强制跳转到HTTPS – HTTPS SSL 教程

兼容:

<!--如果检测到是http页面,则自动跳转到对应的https页面--> <scripttype="text/javascript"> if(document.location.protocol!="https:"){ location.href=location.href.replace(/^http:/,"https:"); } </script>

ASP:

<% IfRequest.ServerVariables("SERVER_PORT")=80Then DimstrSecureURL strSecureURL="https://" strSecureURL=strSecureURL&Request.ServerVariables("SERVER_NAME") strSecureURL=strSecureURL&Request.ServerVariables("URL") Response.RedirectstrSecureURL EndIf %>

 

PHP:

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

 

©2020-2024   万云SSL证书  (www.sslssl.com.cn)  万云科技   豫ICP备2020034358号-10