|
修改前注意備份!
查找修改文件discuz_application.php
找到 source/class/discuz/discuz_application.php (約第187行處)
- $_G['isHTTPS'] = ($_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false;
復制代碼 修改為- $_G['isHTTPS'] = ($_SERVER['SERVER_PORT'] == 443 || $_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false;
復制代碼 查找修改文件avatar.php
找到 uc_server/avatar.php (約第13行處)
- 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'], '/'))));
復制代碼 查找修改文件admin.php
找到 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'], '/'))));
復制代碼 修改后臺設置
后臺 >全局 > 站點 URL,改為HTTPS
后臺 > 站長 > UCenter 設置 > UCenter 訪問地址,改為HTTPS
UCenter 后臺 > 應用管理 > 應用的主 URL,改為HTTPS
做到這一步若還有問題,逐步排查模板、數據庫等地方
|
|