$mobileUrl = $_SERVER['REQUEST_URI']; $ua = $_SERVER["HTTP_USER_AGENT"]; if ((strpos($mobileUrl, "detail_") !== FALSE) && ((preg_match("/^DoCoMo/i", $ua)) || (preg_match("/^(J\-PHONE|Vodafone|MOT\-[CV]|SoftBank)/i", $ua)) || (preg_match("/^KDDI\-/i", $agent)) || (preg_match("/UP\.Browser/i", $ua)) || (strstr($ua,"WILLCOM")))) { if (substr($mobileUrl, 0, 1) == "/") $mobileUrl = "http://www.ueroku-wake.net". $mobileUrl; $mobileUrl = str_replace("/shops/", "/m/", $mobileUrl); header("Location: ". $mobileUrl); } ?>