1

I am working on a site and working on a component that will take users using wap or xhtml-mp and redirect them to sites specifically setup for those devices. Is there a good standard way of detecting which of these the user is using?

Tanerax
  • 5,826
  • 5
  • 29
  • 27

4 Answers4

5

Because no matter what you do you WILL get it wrong sooner or later, each version of the site should include a link to a page where the user can choose an appropriate format. Once they chose, cookie them and, if present, use that cookie as an override to whatever user-agent sniffing would have told you.

In addition to user agent sniffing if your site involves logging in you can store that preference permanently and re-cookie them, if needed, upon login. If it's obvious from the user agent string just use that, if it's not, ask them to choose from a list of your available options and store their choice as the default.

masukomi
  • 10,313
  • 10
  • 40
  • 49
3

There's always the User Agent string. But that means keeping up with all the latest browsers, and differentiating between them isn't always simple.

Instead of redirecting to a completely different page, try using a media selector in your style sheets to tweak your normal content for the smaller screen.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • Its not quite the look we are switching them to a different version of the site its more the data viewed, and formatted. – Tanerax Dec 04 '08 at 15:09
2

Check this and WURFL.

Community
  • 1
  • 1
fravelgue
  • 2,633
  • 2
  • 24
  • 23
1

User Agent Sniffing

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614