Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 12th, 2008, 10:11 AM
Loyola05 Loyola05 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Location: Chicago, IL
Posts: 54 Loyola05 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 27 m 52 sec
Reputation Power: 0
Mobile Device sniffing

Let me start by saying I'm not the best Apache programmer... I'm familiar enough, but it's not exactly my specialty.

I've been tasked with creating a "mobile" version of a client's website. This "mobile" version is not just stripped down content... it's a unique subdirectory of their site with limited content.

I need to redirect users coming into the site to this directory IF they're using a mobile device.

Talking to my sys-admin, it looks like I have two pretty-good options:

(1) use Apache to sniff the HTTP_USER_AGENT for known mobile browsers; if one is found, redirect to the mobile directory

(2) use Apache to sniff the HTTP_ACCEPT to see if the browser supports WMA or WML; if it does, redirect to the mobile directory

Here's my question... is either solution better? Is there a better solution?

Option #1 leads me to believe that we'd have to constantly update a list of known mobile browsers...

Option #2 leads me to believe that some non-mobile browsers might accidentally get redirected if they support WMA or WML...

Anyone have some thoughts?

Reply With Quote
  #2  
Old June 12th, 2008, 03:26 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,730 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 23 h 21 m 17 sec
Reputation Power: 375
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
WURFL is a database of devices that should help in your quest. Depending on your implementation language they have examples that can do what you're looking for. However, no matter how frequently you update your local database there is always going to be the chance of missing a user-agent here and there.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #3  
Old June 13th, 2008, 09:03 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,461 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 15 h 14 m
Reputation Power: 825
Thread moved from Apache to WAP ... I didn't see a relation to Apache.

(3) Use at mobile stylesheet so you don't have to build a new website.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > Mobile Device sniffing


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT