• mark8888

    (@mark8888)


    Hi,

    what’s the correct code to redirect traffic based on IP with your plugin. I tried like that but it didn’t work.

    <?php
    $country_code = $_SERVER[“HTTP_CF_IPCOUNTRY”];

    if($country_code==”us”){
    header(“Location: https://xxx.org/xxx/ “);
    }
    else
    {
    header(“Location: https://xxxx/xxxx.com “);
    }
    ?>

    Thank you,
    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Paul

    (@paultgoodchild)

    The code here isn’t specific to this plugin, but rather CloudFlare.

    This plugin isn’t designed to expose this sort of geo information in this sort of way, but we will be developing this in the future.

    Thread Starter mark8888

    (@mark8888)

    ah. ok.

    so i can’t pull the visitor IP in some way to use it like with cloudflare?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to redirect traffic based on IP’ is closed to new replies.