说明:由于用了百度云加速,所以在看wordpress后台评论的时候看到的是CDN的IP而不是访客真是IP,这其实无关紧要。但是最近Limit Login Attempts插件给我发邮件有人试图暴力破解后台密码的时候显示的IP也是CDN的IP,封IP比较麻烦,于是搜索了下找到了解决办法,参考自百度百科的教程。
1.使用WinSCP等编辑软件打开wordpress中的wp-config.php文件;
2.在wp-config.php文件的第一个<!--?php标记后面粘贴下面的代码:

if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$list = explode(‘,’,$_SERVER['HTTP_X_FORWARDED_FOR']);
$_SERVER['REMOTE_ADDR'] = $list[0];
}

3.保存修改后的文件;
4.更新您wordpress目录中的wp-config.php文件!

原理分析:我们的wordpress是使用”REMOTE_ADDR”这个函数来获取访客的IP地址的,那么只要我们将获取的函数替换成”HTTP_X_FORWARDED_FOR”,一般就可以了!

Unbiased Report Exposes the Unanswered Questions on Phd Thesis Australia

What Is So Fascinating About Phd Thesis Australia? Reading academic articles and searching for various writing resources online will make it possib...

阅读全文

Professional Custom Essay Writing Service Help!

Where to Find Professional Custom Essay Writing Service When you purchase an essay from us, then you’re sure to relish individual approach be...

阅读全文

The Most Popular Essay Writing Contests Canada

So for those who have an essay assigned that you will need help with, you can purchase essay online cheap from us. There are several varieties of e...

阅读全文

评论已经关闭。