If you are using Cloudflare for geolocation then this page has no relevance or interest.
The CCA & Country Caching Plugins check your server’s IP variables (in this order) “HTTP_CLIENT_IP”, “HTTP_X_FORWARDED_FOR”, “HTTP_X_REAL_IP and “REMOTE_ADDR” for the first occurrence of a valid IP address. However you can use different PHP server variables, or change the order of checking:
It’s a simple modification. Upload a file named IPvar-custom-order.inc containing a PHP array (as per examples) to your “/wp-content/cca_maxmind_data/” directory. N.B. if it is not valid PHP it will break WordPress until you correct it.
Example 1: only “HTTP_X_FORWARDED” should be used to to identify visitor IP address.
<?php
$address_vars = array('HTTP_X_FORWARDED');
?>
Example 2: “REMOTE_ADDR” should be used to to identify visitor IP address; BUT if it is not set or invalid (e.g. private/local address) then use “HTTP_X_REAL_IP”.
<?php
$address_vars = array('REMOTE_ADDR', 'HTTP_X_REAL_IP');
?>
Leave a Reply