CloudFlare provides the user's country from the originating IP but I need location on a city level so I've added MaxMind's GeoCityLite using the mod\_geoip Apache script.

The problem is now to get the IP in a php variable, I'm using something like

```
$country = apache_note("GEOIP_COUNTRY_CODE");

```

This is great but the IP mod\_geoip is using is the CloudFlare DNS, not the end user. CloudFlare offers the server variable HTTP\_CF\_CONNECTING\_IP to use the end-user IP but how do I use THAT variable/IP in the mod\_geoip?

Can this be done with a few lines in htaccess?

Edit: I have a workaround using the php API for geoip which is easy but the benchmarks using the apache lookup of the php api is much much better so I'd rather find this solution.