채택완료

특정경로 강제로 이동 시키기 질문드립니다.

2020-10-20 (화) 10:39:34 1,738

이 도메인으로 접속했을때 https://도메인/?device=mobile

뒤에 /?device=mobile는 지우고 강제로 https://도메인으로 접속되게 하는 방법이 있을까요?

답변 2개

채택된 답변
+20 포인트

if ($_GET['device']=='mobile'){

?>

<script>location.href='https://도메인/';</script>

<?php

exit;

}

if ($_GET['device']=='mobile'){

?>

<script>location.href='https://도메인/?device=pc';</script>

<?php

exit;

}

답변을 작성하려면 로그인이 필요합니다.