모바일 홈페이지 URL 포워딩

2016. 10. 18. 16:22·Programing
반응형

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0, user-scalable=yes, target-densitydpi=medium-dpi">

<title>타이틀</title>

<style type="text/css">

.viewer { width:100%; margin:0 auto; }

.viewer img { max-width:100%; }

table { width:100%; margin:auto; text-align:center;}

</style>


<script type="text/javascript">


var mobileInfo = new Array('Android', 'iPhone', 'iPod', 'BlackBerry', 'Windows CE', 'SAMSUNG', 'LG', 'MOT', 'SonyEricsson');

for (var info in mobileInfo){

    if (navigator.userAgent.match(mobileInfo[info]) != null){

    

     //로그추가코드 START

(function(){

 var http_us = "http://모바일URL/main.do"; //이동URL

 var http_param = [];

 var str_param = "";

 if(document.location.search != ""){

  http_param.push(document.location.search.replace(/^\?/, ""));

 }

 if(document.referrer != ""  && !/OV_REFFER/.test(document.location.search)){

 http_param.push("OV_REFFER="+document.referrer);

 }

 if(http_param.length > 0){

  str_param = (/\?/.test(http_us) ? "&" : "?")+http_param.join("&");

 }else{

  str_param = "";

 }

 location.href =http_us+str_param;

})();

//로그추가코드 END

     //location.href = 'https://모바일URL/main.do';

        break;

    }

}


/*

if ( document.body.clientWidth < 800 ) {

location.href = 'https://모바일URL/main.do';

}

*/


var myWidth = 0, myHeight = 0;

if( typeof( window.innerWidth ) == 'number' ) {

  //Non-IE

  myWidth = window.innerWidth;

  myHeight = window.innerHeight;

} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

  //IE 6+ in 'standards compliant mode'

  myWidth = document.documentElement.clientWidth;

  myHeight = document.documentElement.clientHeight;

} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

  //IE 4 compatible

  myWidth = document.body.clientWidth;

  myHeight = document.body.clientHeight;

}


if ( myWidth < 800 ){

//로그추가코드 START

(function(){

 var http_us = "http://모바일URL/main.do"; //이동URL

 var http_param = [];

 var str_param = "";

 if(document.location.search != ""){

  http_param.push(document.location.search.replace(/^\?/, ""));

 }

 if(document.referrer != ""  && !/OV_REFFER/.test(document.location.search)){

 http_param.push("OV_REFFER="+document.referrer);

 }

 if(http_param.length > 0){

  str_param = (/\?/.test(http_us) ? "&" : "?")+http_param.join("&");

 }else{

  str_param = "";

 }

 location.href =http_us+str_param;

})();

//로그추가코드 END

//location.href = 'https://모바일URL/main.do';

}

else{

//로그추가코드 START

(function(){

 var http_us = "http://이동URL/main.do"; //이동URL

 var http_param = [];

 var str_param = "";

 if(document.location.search != ""){

  http_param.push(document.location.search.replace(/^\?/, ""));

 }

 if(document.referrer != ""  && !/OV_REFFER/.test(document.location.search)){

 http_param.push("OV_REFFER="+document.referrer);

 }

 if(http_param.length > 0){

  str_param = (/\?/.test(http_us) ? "&" : "?")+http_param.join("&");

 }else{

  str_param = "";

 }

 location.href =http_us+str_param;

})();

//로그추가코드 END

//location.href = 'https://이동URL/main.do';

}


//location.href = 'https://이동URL/main.do';


</script>


반응형
저작자표시 (새창열림)

'Programing' 카테고리의 다른 글

[Jenkins]Email Extension Plugin 모니터링  (0) 2016.11.25
[MYSQL]DB 튜닝(innodb / my.cnf)  (0) 2016.11.14
[Jenkins]소스 형상관리툴 환경셋팅(Linux)  (0) 2016.10.07
[Window]ROBOCOPY 윈도우서버 배치파일 파일 복사 및 삭제  (0) 2016.09.29
[Maven]Maven Build시 OutOfMemoryError  (0) 2016.09.29
'Programing' 카테고리의 다른 글
  • [Jenkins]Email Extension Plugin 모니터링
  • [MYSQL]DB 튜닝(innodb / my.cnf)
  • [Jenkins]소스 형상관리툴 환경셋팅(Linux)
  • [Window]ROBOCOPY 윈도우서버 배치파일 파일 복사 및 삭제
애플자라
애플자라
    반응형
  • 애플자라
    애플자라
    애플자라
  • 전체
    오늘
    어제
    • 분류 전체보기 (655)
      • Linux (93)
      • Programing (92)
      • Flex, Laszlo (15)
      • Database (168)
      • Network (15)
      • Data (14)
      • Tips (119)
      • 여행★ (1)
      • Board (115)
      • 맛집탐방 (3)
      • 아이원츄 (12)
  • 블로그 메뉴

    • 홈
    • 태그
    • 미디어로그
    • 위치로그
    • 방명록
  • 링크

    • Love&Smile
    • Husk's repository
    • StartUp
    • DSDSTUDIO Experimentals
    • 신선
    • DEV.SEULKI.KR[이슬기]
    • Live Bit Block
  • 공지사항

  • 인기 글

  • 태그

    백업
    sql
    윈도우
    테이블
    delete
    IP
    데이터
    리눅스
    mssql
    파일
    server
    Oracle
    설정
    Windows
    select
    table
    자동차
    DATABASE
    eclipse
    Toad
    user
    Linux
    java
    오라클
    tomcat
    DB
    apache
    MySQL
    Shell
    서버
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
애플자라
모바일 홈페이지 URL 포워딩
상단으로

티스토리툴바