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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.