文章摘要:怎么辨别http和https
利用php对http与https进行辨别,具体方法如下: $http_type = ((isset($_SER […]
利用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://';