Plugin Support
qtwrk
(@qtwrk)
Hi,
If your site uses cookie to store geolocation , please add this code into your .htaccess
RewriteRule .* - [E=Cache-Vary:cookie_name]
If your site use server-side geo ip module , then please check this wiki
Best regards,
Honestly nor Cookie Neither Server-Side module i guess we can call it.
Just I’m using GeoIP plugin to detect IP of customer with GeoLocation.MDB and I’m using different content for each geo loction countries with this variable
<?php if (function_exists(‘geoip_detect2_get_info_from_current_ip’)) { ?>
<?php $userInfo = geoip_detect2_get_info_from_current_ip(); ?>
<?php if ($userInfo->country->isoCode == ‘AT’) { ?>
<?php if( have_rows(‘austria_geo_target_deal’, $bonus->ID) ): ?>
<?php while ( have_rows(‘austria_geo_target_deal’, $bonus->ID) ) : the_row(); ?>
<?php if( get_row_layout() == ‘austria_geo_deal’ ): ?>
<?php include( plugin_dir_path( __FILE__ ) . ‘frontpage_advert_list_compile.php’); ?>
<?php else : ?>
<?php include( plugin_dir_path( __FILE__ ) . ‘frontpage_advert_list_default.php’); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php else : ?>
<?php include( plugin_dir_path( __FILE__ ) . ‘frontpage_advert_list_default.php’); ?>
This reason Cache is just asking this request at php side and store it. After then when people comes from another countries, it is not working. last shown cached page bringing to other worldwide people. I tried to use htacces code which you send me at server-side part. its not working.
Also I’m using Cloudflare. Also i disable it but didn’t change. I’M trying to understand and to find solution for it.
Simply I’m using ACF and each country has different POST ORDER list at custom post types and each posts has different content or variables.
Its like for example
JAPAN has Different post order list / XYZ Brand comes as first at page, at INDIA, XYZ Brand comes as third one at list. Also COMMISION of item is for example %12 for JAPAN user and %10 for AUSTRIA user. This reason This PHP ACF IF/ELSE statements are working at background to bring specific fields for each post and each taxonomy part
Hello Again, some tuning and configuration at server-side part, Think now system seems working
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CN|RU|TR|MT|DE|AT|AU|US|FR|IR|NL)$
RewriteRule .* – [E=Cache-Control:vary=%{ENV:GEOIP_COUNTRY_CODE}]
Just US not working because US has Subdivision STATE geolocation detection at background. I’m trying to configure subdivision part with country code at the same time.
Sounds good, please keep post us if you have any problems.