$httpType = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
$selfurl = $httpType . \I('SERVER.HTTP_HOST') . \I('server.REQUEST_URI');
标签:HTTP,https,PROTO,url,SERVER,获取,&&,ThinkPHP,HTTPS
From: https://www.cnblogs.com/sunr/p/17158643.html