<?
$mobileKeyWords = array ('iPhone','iPod','BlackBerry','Android','Windows CE','Windows CE;','LG','MOT','SAMSUNG','SonyEricsson','Mobile','Symbian','Opera Mobi','Opera Mini','IEmobile');

for($i = 0 ; $i < count($mobileKeyWords) ; $i++) {

if(strpos($_SERVER['HTTP_USER_AGENT'],$mobileKeyWords[$i]) == true) {

header("Location: http://모바일페이지경로");

exit;

}
}

if(strpos($HTTP_HOST, '접속도메인') == strlen($HTTP_HOST)-strlen('접속도메인)) {
    header("location:http://연결할URL".$REQUEST_URI);
    exit;
}
else
header('Location: 예외처리경로<http형식의 절대주소로기입>');


?>