I want to do this:
if (user from other website, like google, or input our website URL directly in the browser)
{
//redirect according to browser languge
if (!preg_match('/en-US/', $_SERVER['HTTP_USER_AGENT']))
{
wp_redirect("http://cn.gearor.com");
}
}
I don't know how to write the first if statement, I don't know how to get the from URL and how to check it's my website or other websites. If it's my website, do nothing, if it's not my website, check if the browser is English, if not, redirect to http://cn.gearor.com