Cloudflare

daannet

Member
Hello,

Does anyone know here a way to get the visitor's direct (real) ip with a plugin? Thanks in advance.. I wouldn't change the core.. 8)
 

Basti

Administrator
Staff member
By some user of visiolist
For the voting (IP checking), I will be using a CDN (Cloudflare) for the site, so the IP address of the users will be passed via "HTTP_CF_CONNECTING_IP". If the user is connecting directly, the IP will be "HTTP_CF_CONNECTING_IP".
I suppose this is your issue?
if so you could make a simple plugin with file global_start.php
and use in there
$_SERVER['REMOTE_ADDR'] = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : $_SERVER['REMOTE_ADDR'];
 
Top