• Hello,

    I am trying to create site-wide redirects for two separate locations. I want to contain our UK users, if they enter .com it will redirect them to the .co.uk and vice versa if any users outside of the UK try to enter .co.uk they will be directed to .com.

    I found this code:

    <?php

    /**
    * Redirect users according to location
    */

    function country_geo_redirect() {
    $country = getenv(‘HTTP_GEOIP_COUNTRY_CODE’);
    if ( $country == “GB” ) {
    wp_redirect( ‘https://www.ggpoker.co.uk&#8217;;, 301 );
    exit;
    } else {
    wp_redirect( ‘https://www.ggpoker.com&#8217;;, 301 );
    exit;
    }
    }
    add_action(‘init’, country_geo_redirect’);

    And where is this function to be placed and how do we call the this function so it is SITEWIDE?

    Any help/assistance is greatly appreciated.

    Regards,

    Roudy

Viewing 1 replies (of 1 total)
  • I am looking to do the exact same thing – have you found the solution? I would assume this code goes in your functions.php for each site.

Viewing 1 replies (of 1 total)
  • The topic ‘How To Create Full Site Redirects Using The Plugin’ is closed to new replies.