说明:由于用了百度云加速,所以在看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”,一般就可以了!

Advice on Buying An Outdoor Covered Puppy Kennel

The great thing about an outdoor covered puppy kennel is that it allows you to just walk out of the house and let your family pet out in the wi...

阅读全文

Vital Pieces of Protected Dog Kennel

Covered puppy kennels happen to be in the list of the most extremely important products when you have a huge breed puppy. There are actually three...

阅读全文

A Dog and Technology Review

I recently saw a video to the Internet that had been made simply by someone who said that she would definitely do a puppy and tech review. I...

阅读全文

评论已经关闭。