본문 바로가기

Internet World/Mobile

[Mobile] userAgent 에이전트를 이용한 모바일 페이지로 자동 이동

일전에 에이전트를 알아볼 수 있는 스크립트를 포스팅한적이 있는데요. "navigator.userAgent" 말이죠. 그렇다면 오늘은 이것을 이용하여 모바일 기기가 접속을 했을 때, 모바일 사이트로 바로 이동하게 하는 것을 해보도록 하겠습니다. 모든 일들이 마찬가지겠지만 이 일을 잘 해결하기 위해서는 일단 필요한 것들과 일의 과정을 정리해보면 되겠는데요. 우선 작업의 과정을 살펴보면,

1. 사이트에 접속한다.
2. 브라우저를 체크한다.
3. 에이전트에 따라서 페이지를 연결한다.

대략 이렇게 세가지 단계에 의해서 일을 처리하면 될텐데요. 그렇다면 2번째의 브라우저를 체크 하는 방법은 에이전트를 검사하는 방법을 사용하면 됩니다.

navigator.userAgent

그 다음에 확인된 브라우저에 따라서 페이지를 연결하면 되는데, 수많은 브라우저에서 어떻게 모바일 브라우저를 찾느냐가 문제입니다. 


모바일 브라우저의 에이전트를 구분하는 방법은 에이전트 내에 있는 긴 내용 중에 몇개의 키워드를 찾아내서 골라내면 되는데요. 수많은 에이전트 중에서 가장 작은 수의 키워드를 찾아내는 일을 결코 쉬운일이 아니네요. 아래는 Wikipedia 에 있는 모바일 브라우저에 대한 user agent 의 목록인데요.

Apple Inc.

  • Apple iPhoneMozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/1A542a Safari/419.3
  • iPod TouchMozilla/5.0 (iPod; U; CPU iPhone OS 3_1_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7C145
  • Apple iPadMozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10

[edit]BenQ-Siemens (Openwave)

  • S68SIE-S68/36 UP.Browser/7.1.0.e.18 (GUI) MMP/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • EF81SIE-EF81/58 UP.Browser/7.0.0.1.181 (GUI) MMP/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1

[edit]BlackBerry

  • BlackBerry 7100iBlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103
  • BlackBerry 7130eBlackBerry7130e/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/104
  • BlackBerry 7250BlackBerry7250/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • BlackBerry 7230BlackBerry7230/3.7.0
  • BlackBerry 7520BlackBerry7520/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • BlackBerry 7730BlackBerry7730/3.7.0
  • BlackBerry 8100Mozilla/4.0 BlackBerry8100/4.2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
  • BlackBerry 8130BlackBerry8130/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/109
  • BlackBerry 8310BlackBerry8310/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/121
  • BlackBerry 8320BlackBerry8320/4.3.1 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • BlackBerry 8700BlackBerry8700/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
  • BlackBerry 8703eBlackBerry8703e/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105
  • BlackBerry 8820BlackBerry8820/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102
  • BlackBerry 8830BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105
  • BlackBerry 9000BlackBerry9000/4.6.0.65 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102
  • BlackBerry 9530BlackBerry9530/4.7.0.167 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102 UP.Link/6.3.1.20.0
    BlackBerry9530/5.0.0.328 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/105
  • BlackBerry 9630 Tour BlackBerry9630/4.7.1.40 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/104
  • BlackBerry 9700 Bold: BlackBerry9700/5.0.0.423 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/100

[edit]Google

  • Android SDK 1.5r3: Mozilla/5.0 (Linux; U; Android 1.5; de-; sdk Build/CUPCAKE) AppleWebkit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1
  • Nexus OneMozilla/5.0 (Linux; U; Android 2.1-update1; en-us; Nexus One Build/ERE27) AppleWebkit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17

[edit]HTC

  • DesireMozilla/5.0 (Linux; U; Android 2.1-update1; fr-fr; desire_A8181 Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
  • LegendMozilla/5.0 (Linux; U; Android 2.1; fr-fr; HTC Legend 1.32.163.1 Build/ERD79) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
  • 8500HTC-8500/1.2 Mozilla/4.0 (compatible; MSIE 5.5; Windows CE; PPC; 240x320)
  • 8500HTC-8500/1.2 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.6) UP.Link/6.3.1.17.0
  • P3650HTC_P3650 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.6)
  • P3450Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12) PPC; 240x320; HTC P3450; OpVer 23.116.1.611
  • S710Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.6) SP; 240x320; HTC_S710/1.0 ...
  • HeroMozilla/5.0 (Linux; U; Android 1.5; en-za; HTC Hero Build/CUPCAKE) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1
  • TattooMozilla/5.0 (Linux; U; Android 1.6; en-us; HTC_TATTOO_A3288 Build/DRC79) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1
  • MagicMozilla/5.0 (Linux; U; Android 1.5; en-dk; HTC Magic Build/CUPCAKE) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1
  • EVO 4GMozilla/5.0 (Linux; U; Android 2.1-update1; en-us; Sprint APA9292KT Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko)

[edit]LG Electronics

  • LG U880: LG/U880/v1.0
  • LG B2050: LG-B2050 MIC/WAP2.0 MIDP-2.0/CLDC-1.0
  • LG C1100: LG-C1100 MIC/WAP2.0 MIDP-2.0/CLDC-1.0
  • LG CU720: LG-CU720/V1.0|Obigo/Q05A Profile/MIDP-2.0 Configuration/CLDC-1.1
  • LG CU8080: LGE-CU8080/1.0 UP.Browser/4.1.26l
  • LG G1800: LG-G1800 MIC/WAP2.0 MIDP-2.0/CLDC-1.0
  • LG G210: LG-G210/SW100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G220: LG-G220/V100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G232: LG-G232/V100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G262: LG-G262/V100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G5200: LG-G5200 AU/4.10
  • LG G5600: LG-G5600 MIC/WAP2.0 MIDP-2.0/CLDC-1.0
  • LG G610: LG-G610 V100 AU/4.10 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG G622: LG-G622/V100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G650: LG-G650 V100 AU/4.10 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG G660: LG-G660/V100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G672: LG-G672/V100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G682: LG-G682 /V100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G688: LG-G688 MIC/V100/WAP2.0 MIDP-2.0/CLDC-1.0
  • LG G7000: LG-G7000 AU/4.10
  • LG G7050: LG-G7050 UP.Browser/6.2.2 (GUI) MMP/1.0 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG G7100: LG-G7100 AU/4.10 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG G7200: LG-G7200 UP.Browser/6.2.2 (GUI) MMP/1.0 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG G822: LG-G822/SW100/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0
  • LG G850: LG-G850 V100 UP.Browser/6.2.2 (GUI) MMP/1.0 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG G920: LG-G920/V122/WAP2.0 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG G922: LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1
  • LG G932: LG-G932 UP.Browser/6.2.3(GUI)MMP/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • LG KP500: LG-KP500 Teleca/WAP2.0 MIDP-2.0/CLDC-1.1
  • LG KS360: LG-KS360 Teleca/WAP2.0 MIDP-2.0/CLDC-1.1
  • LG L1100: LG-L1100 UP.Browser/6.2.2 (GUI) MMP/1.0 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG MX8700: LGE-MX8700/1.0 UP.Browser/6.2.3.2 (GUI) MMP/2.0
  • LG T5100: LG-T5100 UP.Browser/6.2.3 (GUI) MMP/1.0 Profile/MIDP-1.0 Configuration/CLDC-1.0
  • LG U8120: LG/U8120/v1.0
  • LG U8130: LG/U8130/v1.0
  • LG U8138: LG/U8138/v2.0
  • LG U8180: LG/U8180/v1.0
  • LG VX9100: LGE-VX9100/1.0 UP.Browser/6.2.3.2 (GUI) MMP/2.0

[edit]Motorola

  • Motorola V3: MOT-V3r/08.BD.43R MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Motorola K1: MOT-K1/08.03.08R MIB/BER2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 EGE/1.0
  • Motorola L6: MOT-L6/0A.52.2BR MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Motorola V9: MOT-MOTORAZRV9/4 BER2.2 Mozilla/4.0 (compatible; MSIE 6.0; 14003181) Profile/MIDP-2.0 Configuration/CLDC-1.1 Op! era 8.00 [en] UP.Link/6.3.0.0.0
  • Motorola V3xx: MOT-RAZRV3xx/96.64.21P BER2.2 Mozilla/4.0 (compatible; MSIE 6.0; 11003002) Profile/MIDP-2.0 Configuration/CLDC-1.1 Opera 8.00 [en] UP.Link/6.3.0.0.0
  • Motorola V9x: MOT-MOTORAZRV9x/9E.03.15R BER2.2 Mozilla/4.0 (compatible; MSIE 6.0; 13003337) Profile/MIDP-2.0 Configuration/CLDC-1.1 Opera 8.60 [en] UP.Link/6.3.0.0.0
  • Motorola Z9: MOT-MOTOZ9/9E.01.03R BER2.2 Mozilla/4.0 (compatible; MSIE 6.0; 11003002) Profile/MIDP-2.0 Configuration/CLDC-1.1 Opera 8.60 [en] UP.Link/6.3.0.0.0
  • Motorola Droid V2.01: Mozilla/5.0 (Linux; U; Android 2.0.1; en-us; Droid Build/ESD56) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
  • Motorola Motoroi(XT720) V2.01: Mozilla/5.0 (Linux; U; Android 2.0.1; ko-kr; XT720 Build/STSKT_N_79.11.31R) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
  • Motorola Motoroi(XT720) V2.1-update1: Mozilla/5.0 (Linux; U; Android 2.1-update1; ko-kr; XT720 Build/STSKT_N_79.11.33R) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
  • Motorola CLIQ: Mozilla/5.0 (Linux; U; Android 1.5; en-us; MB200 Build/CUPCAKE) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mob

[edit]Nokia

  • Nokia 2610: Nokia2610/2.0 (07.04a) Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.1.20.0
  • Nokia 5300: Nokia5300/2.0 (05.51) Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Nokia 5530: Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5530c-2/10.0.050; Profile MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) Safari/525
  • Nokia 5630: Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 Nokia5630d-1/012.020; Profile MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413
  • Nokia 5800: Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/31.0.101; Profile MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413
  • Nokia 6030: Nokia6030/2.0 (y3.44) Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Nokia 6230i: Nokia6230i/2.0 (03.40) Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Nokia 6280: Nokia6280/2.0 (03.60) Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Nokia 6650: Nokia6650d-1bh/ATT.2.15 Mozilla/5.0 (SymbianOS/9.3; U; [en]; Series60/3.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413
  • Nokia E51-1: Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE51-1/220.34.37; Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413
  • Nokia E71x: NokiaE71x/ATT.03.11.1 Mozilla/5.0 SymbianOS/9.3; U; [en]; Series60/3.2; Profile/MIDP-2.1 Configuration/CLDC-1.1 AppleWebKit/413 KHTML, like Gecko) Safari/413 UP.Link/6.3.0.0.0
  • Nokia N70: NokiaN70-1/5.0616.2.0.3 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Nokia N75: NokiaN75-3/3.0 (1.0635.0.0.6); SymbianOS/9.1 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1) UP.Link/6.3.0.0
  • Nokia N78: Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 NokiaN78-1/12.046; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413
  • Nokia N80: NokiaN80-1/3.0(4.0632.0.10) Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Nokia N90: NokiaN90-1/5.0607.7.3 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • Nokia N95: Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95/11.0.026; Profile MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413
  • Nokia N97-3: Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-3/21.2.045; Profile/MIDP-2.1 Configuration/CLDC-1.1;) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.4

Note that Nokia Symbian phones may have two different user-agent strings, one for the classical WAP like:

nokia_e65 (partial string)

And one for a traditional browser (Mozilla-like browser):

Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es65

The string that is presented depends on the APN settings that are used for browsing (WAP/ISP). As the traditional browser string does not usually give any clues as to the type of device, the user-agent alone is not a guarenteed method of identifying Nokia devices. However, when the traditional browser user-agent is used, Nokia devices also provide the x-Device-User-Agent header, which contains the device specific user-agent.

[edit]Palm

  • Treo 650: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PalmSource/hspr-H102; Blazer/4.0) 16;320x320
  • Pre: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.0
  • Pixi: Mozilla/5.0 (webOS/Palm webOS 1.2.9; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pixi/1.0

[edit]Samsung

  • Samsung A737: SAMSUNG-SGH-A737/UCGI3 SHP/VPP/R5 NetFront/3.4 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1 UP.Link/6.3.1.17.0
  • Samsung A737: SAMSUNG-SGH-A737/1.0 SHP/VPP/R5 NetFront/3.3 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1 UP.Link/6.3.0.0.0
  • Samsung A767: SAMSUNG-SGH-A767/A767UCHG2 SHP/VPP/R5 NetFront/3.4 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1 UP.Link/6.3.0.0.0
  • Samsung A867: SAMSUNG-SGH-A867/A867UCHG5 SHP/VPP/R5 NetFront/3.4 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1 UP.Link/6.3.0.0.0
  • Samsung A877: SAMSUNG-SGH-A877/A877UCHK1 SHP/VPP/R5 NetFront/3.5 SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1 UP.Link/6.3.0.0.0
  • Samsung D600SAMSUNG-SGH-D600/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0
  • Samsung Z720SAMSUNG-SGH-Z720/1.0 SHP/VPR/R5 NetFront/3.3 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1
  • Samsung SGH-E250SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0
  • Samsung SGH-U600SEC-SGHU600/1.0 NetFront/3.2 Profile
  • Samsung SGH-U900SAMSUNG-SGH-U900-Vodafone/U900BUHD6 SHP/VPP/R5 NetFront/3.4 Qtv5.3 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1
  • Samsung SGH-T919SAMSUNG-SGH-T919/919UVHL3SHP/VPP/R5NetFront/3.5SMM-MMS/1.2.0profile/MIDP-2.1configuration/CLDC-1.1
  • Samsung SGH-i900 Omnia: SAMSUNG-SGH-i900/1.0 Opera 9.5
  • Samsung SGH-i907SAMSUNG-SGH-i907/UCHI5 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)
  • Samsung GT-S5230SAMSUNG-GT-S5230/S523MXEIL2 SHP/VPP/R5 Jasmine/1.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1
  • Samsung i617: SAMSUNG-SGH-I617/1.0 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12) UP.Link/6.3.0.0.0
  • Samsung i7500 Galaxy: Mozilla/5.0 (Linux; U; Android 1.5; de-de; Galaxy Build/CUPCAKE) AppleWebkit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1

Opera Mini on Samsung Z720: Opera/9.50 (J2ME/MIDP; Opera Mini/4.1.11355/542; U; en)

[edit]SonyEricsson

  • SonyEricsson K510iSonyEricssonK510i/R4CJ Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson K550iSonyEricssonK550i/R8BA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson K600iSonyEricssonK600i/R2BA Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson K610iSonyEricssonK610i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson K630iSonyEricssonK630i/R1CA Browser/NetFront/3.4 Profile/MIDP-2.1 Configuration/CLDC-1.1
  • SonyEricsson K700SonyEricssonK700/R1A Profile/MIDP-1.0 MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson K750iSonyEricssonK750i/R1CA Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson K800iSonyEricssonK800i/R8BF Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson W800iSonyEricssonW800i/R1AA Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson W810iSonyEricssonW810i/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson W900iSonyEricssonW900i/R5AH Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1
  • SonyEricsson W995iSonyEricssonW995/R1DB Browser/NetFront/3.4 Profile/MIDP-2.1 Configuration/CLDC-1.1 JavaPlatform/JP-8.4.1
  • SonyEricsson Z500aSonyEricssonZ500a/R1A SEMC-Browser/4.0.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.1.20.0
  • SonyEricsson C901SonyEricssonC901/R1EA Browser/NetFront/3.4 Profile/MIDP-2.1 Configuration/CLDC-1.1 JavaPlatform/JP-8.4.2
  • SonyEricsson C905SonyEricssonC905/R1FA Browser/NetFront/3.4 Profile/MIDP-2.1 Configuration/CLDC-1.1 JavaPlatform/JP-8.4.3
  • SonyEricsson X10Mozilla/5.0 (Linux; U; Android 1.6; es-es; SonyEricssonX10i Build/R1FA016) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1

출처는 바로 이곳, Wikipedia
정말 다양한 기기와 그에 따른 다양한 에이전트가 있는데요. 단지 Mobile로 찾아내는 것은 옳은일 같지 않아 보이네요. 몇개를 찾아 본 결과 이렇게 된다고 볼 수 있습니다.

iPhone, iPod, BlackBerry, Android, Windows CE, LG, MOT, SAMSUNG, SonyEricsson

이렇게 분류할 수 있을 것 같은데요. 이렇게 하면 LG나 SAMSUNG 같은 업체가 모바일이 아닌 OS나 브라우저를 만들게 된다면 심히 더 고민을 해봐야 할텐데요. 아직까지는 모바일 기기 밖에 없으니 이렇게 커버가 가능 할 것 같으네요. 그리고 iPad는 제외하였습니다. 모바일기기이지만 아이패드 같은 경우는 일반 페이지를 보기에 더 적합하게 나온것이라는 판단이 들어서요. (물론 플래시로 된 페이지는 아니겠지요.) 그리고 이렇게 분류하게 되면 딱히 "Mobile" 이라는 단어를 첨가하지 않아도 될 듯 합니다. 아직까지는요.

그렇다면 어떻게 자동적으로 이동을 시킬 것인가? 그건 뭐 여러가지 방법들이 있겠지만 여기서 제가 기록할 방법은 자바스크립트를 이용하는 방법인데요. 에이전트 값을 불러오고 우리가 가지고 있는 모바일 에이전트의 키워드와 비교해서 일치하는 경우에는 모바일 사이트로 보내고, 일치하지 않는 경우에는 원래 사이트로 보내는 것인데요.

<script type="text/javascript">
var mobileKeyWords = new Array('iPhone', 'iPod', 'BlackBerry', 'Android', 'Windows CE', 'LG', 'MOT', 'SAMSUNG', 'SonyEricsson');
for (var word in mobileKeyWords){
    if (navigator.userAgent.match(mobileKeyWords[word]) != null){
        location.href = "보내고 싶은 모바일 경로";
        break;
    }
}
</script>

그리고 여기에서 약간 특이한 점은 삼성의 i7500 갤럭시에서 AppleWebkit mobile safari 가 있다는 점입니다. 정말 이상한데요. 제가 갤럭시가 없어서 이 점은 잘 모르겠네요.
반응형