discuz、ecshop、帝國(guó)cms部署https(ssl)后會(huì)員無(wú)法登錄注意,以下教程只針對(duì)我司港臺(tái)虛擬主機(jī)或者亞數(shù)的云主機(jī)香港IP部署SSL后的301跳轉(zhuǎn) 1.discuz部署https后臺(tái)無(wú)法登錄: discuz采用: $_SERVER[‘HTTPS’] 方式判斷,我司虛擬主機(jī)不支持同時(shí)也不支持$_SERVER['HTTP_HOST'],需使用$_SERVER['HTTP_FROM_HTTPS']進(jìn)行判斷,其他php程序同樣適用。 source/class/discuz/discuz_application.php (第188行左右): 查找: $_G['isHTTPS'] = ($_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false; 修改為: $_G['isHTTPS'] = ($_SERVER['HTTP_FROM_HTTPS'] && strtolower($_SERVER['HTTP_FROM_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['HTTP_FROM_HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))));另:使用301方式強(qiáng)制將http跳轉(zhuǎn)到https后會(huì)導(dǎo)致后臺(tái)uc通信失敗。 2.ecshop部署https后臺(tái)無(wú)法登錄: 打開(kāi)includes/cls_ecshop.php 154行左右 查找 return (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://'; 修改為: return isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')||(strtolower($_SERVER['HTTP_FROM_HTTPS']) == 'on') ? 'https://' : 'http://'; 3.帝國(guó)cms部署https后臺(tái)登陸空白 (1)帝國(guó)cms7.2及以下版本 e/class/connect.php function eReturnDomain(){
$domain=RepPostStr($_SERVER['HTTP_HOST'],1);
if(emptyempty($domain))
{
return '';
}
// return 'http://'.$domain; 注釋該行,替換成下兩行內(nèi)容
$httptype = isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')||(strtolower($_SERVER['HTTP_FROM_HTTPS']) == 'on') ? 'https://' : 'http://';
return $httptype.$domain;
}
function FWeReturnDomain(){
$domain=RepPostStr($_SERVER['HTTP_HOST'],1);
if(emptyempty($domain))
{
return '';
}
//return 'http://'.$domain; 注釋該行,替換成下兩行內(nèi)容
$httptype = isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')||(strtolower($_SERVER['HTTP_FROM_HTTPS']) == 'on') ? 'https://' : 'http://';
return $httptype.$domain;
}(2)帝國(guó)cms7.5及以上版本 e/config/config.php 'httptype'=>0 # 全自動(dòng) e/class/connect.php function eCheckUseHttps(){
//if($_SERVER['HTTPS']&&strtolower($_SERVER['HTTPS'])!='off') 注釋該行, 替換成下一行內(nèi)容
if (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')||(strtolower($_SERVER['HTTP_FROM_HTTPS']) == 'on'))
{
return 1;
}
else
{
return 0;
}
}
|
|||||
|
若文檔內(nèi)容對(duì)您沒(méi)有幫助,不能解決問(wèn)題?
您還可以
咨詢?cè)诰客服
或 提交工單
或 搜索常見(jiàn)問(wèn)題
,我們將竭誠(chéng)為您服務(wù)。
|
|||||
| >> 相關(guān)文章 | |||||
|
|
|||||
400-028-5800
028-62778877
您好,非正常上班時(shí)間若有緊急技術(shù)問(wèn)題,請(qǐng)撥總機(jī)后按7號(hào)鍵, 其他問(wèn)題請(qǐng)?zhí)峤还位蛟谏习鄷r(shí)間聯(lián)系,謝謝支持!