title: 建站记录(五)WordPress开启HTTPS tags: [] id: '1476' categories:
访问wp-admin页面时显示 "Too many redirects"
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false){
$_SERVER['HTTPS']='on';
define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
define('CONCATENATE_SCRIPTS', false);
}
/**获取用户真实IP地址*/
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$list = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
$_SERVER['REMOTE_ADDR'] = $list[0];
}