답변 3개
아래 코드로 추가해 보세요.
<?php
if ($_SERVER['REMOTE_ADDR']=="특정 아이피 주소") {
echo "<script>location.href='http://www.abc.com/" style="color: rgb(0, 0, 0); text-decoration: none;">http://m.naver.com'; // 모바일버전 주소 </script>";
} else {
echo "<script>location.href='http://www.abc.com/" style="color: rgb(0, 0, 0); text-decoration: none;">http://www.naver.com'; // PC버전 주소 </script>";
}
?>
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
특정 아이피라면
$ip = "192.168.1.1";라하면
if($ip == 192.168.1.1){
location.href="http://www.abc.com">http://www.abc.com"; //모바일주소
}else{
location.href="http://www.abc.com">http://www.abc.com"; //웹주소
}
이런식으로 하시면됩니다
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인