Discuz启用SSL证书全局https访问

source/class/discuz/discuz_application.php(约第193行处):

查找:

$_G['isHTTPS'] = ($_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false;

修改为:

$_G['isHTTPS'] = ($_SERVER['SERVER_PORT'] == 443 || $_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false;

uc_server/avatar.php (约第14行处):

查找:

define('UC_API', strtolower(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))));

修改为:

define('UC_API', strtolower(($_SERVER['SERVER_PORT'] == 443 || $_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))));
本文由 智诚云集 作者:智诚云集-Xyok.Cn 发表,其版权均为 智诚云集 所有,文章内容系作者个人观点,不代表 智诚云集 对观点赞同或支持。如需转载,请注明文章来源。

发表评论