以下のphpコードで、
PC, スマホ, au, softbank, docomo の切り口で表示するページを制御できます。
phpコード
$Root ="http://example.com"; //PCの場合 $pc = "/"; //iPhoneの場合 $iPhone = "/sp/"; //ドコモの場合 $docomo = "/mobile/"; //auの場合 $au = "/mobile/"; //ソフトバンクの場合 $softbank = "/mobile/"; if(isset($_SERVER['HTTP_USER_AGENT'])){ $UA = $_SERVER['HTTP_USER_AGENT']; if(eregi("DoCoMo",$UA)){ header("Location: $Root$docomo"); }elseif(eregi("UP\.Browser",$UA)){ header("Location: $Root$au"); }elseif(eregi("J-PHONE",$UA)){ header("Location: $Root$softbank"); }elseif(eregi("Vodafone",$UA)){ header("Location: $Root$softbank"); }elseif(eregi("SoftBank",$UA)){ header("Location: $Root$softbank"); }elseif(eregi("J-EMULATOR",$UA)){ header("Location: $Root$softbank"); } }