In the last couple of weeks, I’ve gotten visits from these browsers:
- Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240×320)
- UPG1 UP/4.0 (EISWeb 1.20.1; compatible; Blazer 1.0)
- Nokia Mobile Browser 3.01
to the ‘is your mobile browser not being redirected?’ page.
The first two should have been redirected as I check for the strings ‘Windows CE’ and ‘Blazer’. The last one I’m not familier with – is this Nokia browser a WAP browser or an HTML browser?
Lazyweb, do your thing…
I believe that the Nokia Browser supports both WML and XHTML. Check out the following Nokia forum article for some hints (although it discusses yet another user-agent string):
http://discussion.fo[...]readid=13604
In your redirection logic, you can always examine the Accept HTTP header, and route based upon its content:
e.g.
text/vnd.wap.wml
application/vnd.wap.wmlc
.. for WAP, and other headers, as appropriate, for HTML / XHTML.
Recently I have come across on the mobile browser detection, via PHP. There is another method to check the user HTTP agent, where it will show what browser that user currently using. For PDA, it will show ‘Window CE’. For most web browser, i belive it will show ‘Mozilla’. For wap, it will come from different mobile devices. So you have to check the devices HTTP header differently.
This is the better way that will router the content based on client’s browsers. As PDA and web browser using the same web browser.
Those things I listed above *are* the HTTP_USER_AGENT strings from the browsers. I am currently redirecting based on a string comparison with the HTTP_USER_AGENT the browser is declaring itself as.
how to redirect a html/wap browser to its respective format. i am not familiar with php. i managed to get the code below. is that enough or anything else should be added to it
0)
{
$br = “WML”;
}
else
{
$browser=substr(trim($HTTP_USER_AGENT),0,4);
if($browser==”Noki” || // Nokia phones and emulators
$browser==”Eric” || // Ericsson WAP phones and emulators
$browser==”WapI” || // Ericsson WapIDE 2.0
$browser==”MC21″ || // Ericsson MC218
$browser==”AUR ” || // Ericsson R320
$browser==”R380″ || // Ericsson R380
$browser==”UP.B” || // UP.Browser
$browser==”WinW” || // WinWAP browser
$browser==”UPG1″ || // UP.SDK 4.0
$browser==”upsi” || // another kind of UP.Browser ??
$browser==”QWAP” || // unknown QWAPPER browser
$browser==”Jigs” || // unknown JigSaw browser
$browser==”Java” || // unknown Java based browser
$browser==”Alca” || // unknown Alcatel-BE3 browser (UP based?)
$browser==”MITS” || // unknown Mitsubishi browser
$browser==”MOT-” || // unknown browser (UP based?)
$browser==”My S” || // unknown Ericsson devkit browser ?
$browser==”WAPJ” || // Virtual WAPJAG http://www.wapjag.de
$browser==”fetc” || // fetchpage.cgi Perl script from http://www.wapcab.de
$browser==”ALAV” || // yet another unknown UP based browser ?
$browser==”Wapa”) // another unknown browser (“Wapalyzer”?)
{
$br = “WML”;
}
else
{
$br = “HTML”;
}
}
if($br == “WML”)
{
header(“302 Moved Temporarily”);
header(“Location: “.$wmlredirect);
exit;
}
else
{header(“302 Moved Temporarily”);
header(“Location: “.$htmlredirect);
exit;
}
?>
Everything’s not so simple as it seems to be. I’ve just conducted an experiment and I found out the following – my cellphone embedded browser accepts both xhtml and wml – so that when it detects a wml page it send out an http accept header where wml support declared. if it detects an html page it send out a http accept header where it declares html support. so we have to struggle with ‘smartness’ of mobile phone browsers, too
What abotu 3gp? since you got everything listed for redirection. so ii dont see any mobile 2.0 or 3gp so hope hear from you all soon
Nokia browser 3.0.1 is a browser from Nokia itself, i had it in my old samsung phone! 🙂
and it does get more tedious than this as newer mobiles send out a accept header of text/html and expect a xHTML-MP response in return!
there have to be 2 loops, one for is it a mobile or not as above, and if it is then what to send!
Hello,
What is the right page format for Mobile browsers ?
I created a script not long ago that detects over 200 different types of mobile phones using JavaScript and Regular Expressions that take up just two lines of code for the detection.
Here is the site I used for the mobile browser useragents to create it:
http://www.zytrax.co[...]ile_ids.html
And here is a link to the script:
http://sourceforge.n[...]se_id=632929
I figured other people would find it useful so I shared it.
Sam:
One problem with your script, not all phones support javascript