php - Bypass Geo Redirect for specific directories -
i'm trying bypass redirect specific url within site. wondering if might able help.
the code below code use, original urls replaces example.com
i'd able access http://example.com/admin without redirect occuring.
is there way this, , there way using own ip?
function country_geo_redirect() { $country = getenv('http_geoip_country_code'); if ($country == "us" ) { wp_redirect("http://usa.example.com/"); exit; } else if ($country == "gb" ) { wp_redirect("http://uk.example.com/"); exit; } } add_action('init', 'country_geo_redirect');
you can bypass redirection code if server found ip address.
if ip address == <my ip address> ' nothing here else country_georedirect() end if
Comments
Post a Comment