WordPress.org

Ready to get started?Download WordPress

Forums

WordPress redirect by country ip with specific page (1 post)

  1. kumararul
    Member
    Posted 1 year ago #

    Hello guys

    Does anyone know a worpdress plugin that can redirect users by country ip to a specific page?

    Like if i am from USA and i access http://domain.com then this plugin need to redirect me to the specific page http://domain.com/example-USA

    Another way which is from india access the same page http://domain.com it will be redirected to http://domain.com/example-INDIA in word press page

    I have tested in my local host it will work how to implement the word press specific page

    source code:

    <?php
    $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip));

    if($ip_data && $ip_data->geoplugin_countryName != null)
    {
    $result = $ip_data->geoplugin_countryName;

    // echo $result;

    if ($result == "India")
    {
    //echo "Welcome to India!";

    header("Location: http://localhost:44447/zingyminds/package-India.php");

    exit;
    }

    else
    {
    //echo "Welcome to United States!";

    header("Location: http://localhost:44447/zingyminds/package-US.php");

    exit;
    }
    }
    ?>

    If am clicking the SERVICE page means it will check the ip address with country and redirecting the particular page in word press how

    If anyone Known means help me

    Thanks
    Arulkumar.M

Topic Closed

This topic has been closed to new replies.

About this Topic