一、 wordpress模板开启HTTPS网站访问排版错乱
通过ftp连接在wp-config.php文件中加入如下两行,重启站点生效。
define('FORCE_SSL_ADMIN', true);
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
二、Discuz开启HTTPS网站访问排版错乱
以下配置是让相应域名访问时强制跳转HTTPS
编辑source/class/discuz/discuz_application.php文件
在188行处添加如下:
注:下列示例代码中的"baidu.com"为用户的自有域名,具体问题处理时可将该域名替换为用户的自有域名。
if ($this->endWith($_SERVER['HTTP_HOST'],"baidu.com")) {
$_G['scheme'] = 'https';
}
在207行添加如下代码
private function endWith($haystack, $needle) {
$length = strlen($needle);
if($length == 0){
return true;
}
return (substr($haystack, -$length) === $needle);
}
</