使用腾讯云CDN做HTTPS的WordPress博客时要改的代码
编辑打开网站根目录下的文件wp-settings.php
在最顶部的<?php下面一行,添加以下代码
if(!empty($_SERVER['HTTP_X_FORWARDED_PROTO']))$_SERVER['REQUEST_SCHEME']=$_SERVER['HTTP_X_FORWARDED_PROTO']; if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))$_SERVER['REMOTE_ADDR']=trim(explode(',',$_SERVER['HTTP_X_FORWARDED_FOR'])[0]); if($_SERVER['REQUEST_SCHEME']==='https')$_SERVER['SERVER_PORT']=443;