I am owning some websites, in php, java and html coded. I want them to be viewed comfortably using iphones. ie, the site has to first check whether the site is hit from a pc or mobile (iphone). If its from a mobile, it has to be redirected to another server which loads the mobile view.
Some sites i’ve recently found of doing the same is orkut, facebook,etc. While logging in from a mobile, we are redirected to m.orkut.com from http://www.orkut.com, i’ve to do something similar to that.
I am owning some websites, in php, java and html coded. I want them
Share
Check the user-agent*
and redirect
where necessary.
*Note that the iPhone has many user-agents, and therefore checking the string itself for exact comparison isn’t practical. Instead, look for strings like “iPhone” and “Mobile” to determine the liklihood that the current visitor is on an iPhone.