加在 wordpress的 wp-config.php 开头
1 2 3 4 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $xffaddrs = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']); $_SERVER['REMOTE_ADDR'] = $xffaddrs[0]; } |
测试
加在 wordpress的 wp-config.php 开头
1 2 3 4 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $xffaddrs = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']); $_SERVER['REMOTE_ADDR'] = $xffaddrs[0]; } |
测试