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