═╬簡箪√嗳

 找回密码
 立即注册
搜索
查看: 3388|回复: 0

[分享] Discuz! X3.4 HTTPS 设置

[复制链接]
发表于 2018-7-15 20:38 | 显示全部楼层 |阅读模式
1、修改source/class/discuz/discuz_application.php(第187行)
$_G['isHTTPS'] = ($_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false;
修改为:
$_G['isHTTPS'] = true;
2、修改uc_server/avatar.php(就在头几行)
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’], ‘/’))));
找到 uc_server/admin.php (约第13行处)
define(‘UC_API’, strtolower((isset($_SERVER[‘HTTPS’]) && $_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’], ‘/’))));
以上可不用更改,改了反而有毛病。
3、修改/template/default/common/header.htm
将http://全部查找替换为:https://(一共5处)
4、后台 – 全局 – 站点信息 – 网站 URL:将http://改成https://网址
5、后台 – 站长 – UCenter设置 – UCenter 访问地址改成https://网址
6、后台 – UCenter(如果不能正常访问可以在新窗口打开,也可以直接访问UC地址) – 应用管理 – 点右边的编辑 – 应用的主URL改成https://网址
7、后台 – 工具 – 更新缓存
8、后台 – 界面 – 风格,点击“更新CSS缓存”按钮

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|═╬簡箪√嗳's BBS

GMT+8, 2024-5-2 08:45

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表