IP detection problem
-
Hi everyone
I am building an ecommerce website on Godaddy hosting.
It is behing a reverse proxy so I can not get the real ip of the users. I added [HTTP_X_REAL_IP] code to the wpconfig.file and got users’ real ips.
Unfortunately, the ip starts with :ffff: prefix and Payfort does not accept it. I tried many plugins including WP Cerber but none of them give an ip without :ffff: prefix.
Do you know how to solve it?
https://www.bynicolas.com/code/x-forwarded-for-http-user-real-ip-wordpress-config/
I used this method and many codes but not solving it.
// Code for showing correct client IP address
if ( isset( $_SERVER[‘HTTP_X_FORWARDED_FOR’] ) ) {
$mte_xffaddrs = explode( ‘,’, $_SERVER[‘HTTP_X_FORWARDED_FOR’] );
$_SERVER[‘REMOTE_ADDR’] = $mte_xffaddrs[0];
}Thanks in advance
Raskolt
The topic ‘IP detection problem’ is closed to new replies.