.htninja whitelisting own Ip
-
Hello there, we are using NinjaFirewall (WP Edition) with hosting on wordpress.com and try to whitelist our own ip using the .htninja file.
It is not working as expected. Sometimes users can access the sites with an ip that is not whitelisted and sometimes our own ip gets blocked even though its whitelisted.
This is the code:
if (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’])) {
$ip = $_SERVER[‘HTTP_X_FORWARDED_FOR’];
} else {
$ip = $_SERVER[‘REMOTE_ADDR’];
}if ( $ip == ‘82.32.12.123’ ) {
return ‘ALLOW’;
} else {
return ‘BLOCK’;
}When logging $_SERVER[‘REMOTE_ADDR’] it can be seen that the ip stays the same even though we are changing ip address on the client. In other instances our own ip gets blocked.
Looking forward to your answer.
- The topic ‘.htninja whitelisting own Ip’ is closed to new replies.