Page is a not externally linkable
- Hardware and OS Related Technologies
-- Smartphone, Wireless, and Mobile Technologies
---- Redirect a mobile/PDA to a "lite homepage"


ssvenson - 5:45 pm on May 20, 2004 (gmt 0)


I've done it...

In ASP though, so you will have to look up the appropriate commands in PHP to do the same (easy).

userAgent = Request.ServerVariables("HTTP_USER_AGENT")
userAgent = lcase(userAgent)

if Instr(userAgent, "mozilla") <= 0 then
if Instr(userAgent, "alcatel") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "ericsson") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "nokia") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "panasonic") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "phillips") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "samsung") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "sanyo") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "wml") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "up") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "mot") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "wap") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "ppc") then
Response.Redirect("/ppc/index.asp")
elseif Instr(userAgent, "ce") then
Response.Redirect("/ppc/index.asp")
end if
end if

So basically you get the user agent from the client and parse the string... This works for everything I have so far, except for the ppc line, which I've seen a couple of glitches in...

Shaun


Thread source:: http://www.webmasterworld.com/pda_mobile_computing/260.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com