Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mobile Redirect

I have a webpage and I was recently asked to create the mobile version for it, now that I've done it I was asked to make an automatic redirection so that if the user goes into the webpage through a PDA/iPhone/Smartphone/etc he/she gets automatically directed to the m.website.com but I have no idea how to do this =/ I've tried some php's and javascripts I found using google but nothing so far has helped me. Could you guys?

like image 564
Tsundoku Avatar asked Mar 04 '09 06:03

Tsundoku


1 Answers

Check out WURFL and build a 302 redirector for User-Agents that match its list of mobile browser user-agent strings.

Or, just look for iPhone in the User-Agent and redirect those to your iPhone site. The other browsers command such small market-share it is hardly worth targeting them. iPhone is 67 percent of the mobile web HTML traffic. You could do this in Javascript on your web page.

like image 94
Genericrich Avatar answered Nov 28 '22 00:11

Genericrich