
<?php
session_start();


if(!isset($_SESSION["firsttime"])){
    echo "1";
    $_SESSION["firsttime"]='1'; 
    $country_code = $_SERVER["HTTP_CF_IPCOUNTRY"];
    if($country_code == 'CN'){
        $lang = 'https://chinese.com/sc/index/';
    }elseif($country_code == 'HK' AND $country_code == 'TW'){
        $lang = 'https://chinese.com/zh-hant/index/';
    }else{
        $lang = 'https://chinese.com/index/';
    }

    echo '<script>';
    echo "window.location.assign('".$lang."')";
    echo '</script>';
    echo $lang;

}
else {
echo "2";
}
?>

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
