利用php对http与https进行辨别,具体方法以下:
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
本文来源:https://www.yuntue.com/post/59400.html | 云服务器网,转载请注明出处!