Question

When I go into ibm both in website and mobile I see two different links

http://www.ibm.com/us/en/

http://m.ibm.com/us/en/

How iphone detects mobile version?

http://m.ibm.com/us/en/

I'am working on my project to do different sites but dont know to implement it for iphone since i am not sure how iphone redirects to m.ibm.com

<head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="public" name="Security"><meta content="IBM Corporation" name="DC.Publisher"><meta content="US" name="IBM.Country"><meta content="Joan Renner/Armonk/IBM" name="Owner"><meta content="2012-05-29" scheme="W3CDTF" name="IBM.Effective"><meta content="--" scheme="W3CDTF" name="IBM.Expires"><meta content="en-US" scheme="rfc1766" name="DC.Language"><meta content="2013-01-07" scheme="iso8601" name="DC.Date"><meta content="© Copyright IBM Corp. 2013, 2012" name="DC.Rights"><meta content="IBM101" scheme="IBM_SubjectTaxonomy" name="DC.Subject"><meta content="CT002" scheme="IBM_ContentClassTaxonomy" name="DC.Type"><meta content="" scheme="IBM_IndustryTaxonomy" name="IBM.Industry"><title>IBM - United States</title><link type="text/css" title="wireless" rel="stylesheet" media="all" href="//1.www.s81c.com/common/v17/css/mobile.css"><script type="text/javascript" src="//1.www.s81c.com/common/v17/mobile.js">//</script><script type="text/javascript" src="//1.www.s81c.com/common/js/dynamicnav/www/usen-utf8.js"></script><script type="text/javascript">window.onload = function() { ibmInit(); };</script><meta content="ibm.com wireless - Mobile Webmaster/Watson/IBM" name="Source"><meta content="noindex,nofollow" name="Robots"><meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width"><meta name="apple-mobile-web-app-capable" content="yes"><link rel="alternate" type="text/html" title="Non Wireless" href="http://www.ibm.com/us/en/"><script type="text/javascript" src="chrome-extension://bfbmjmiodbnnpllbbbfblcplfjjepjdn/js/injected.js"></script></head>
Was it helpful?

Solution

Use javascript to detect if the browser is an iPhone and then redirect to a new page if so.

<script type="text/javascript">
    if(window.navigator.userAgent.indexOf("iPhone") > -1){
        document.location.href = "http:/m.ibm.com/us/en/";
    }
</script>

OTHER TIPS

Hope this link mobileesp helps you. It has code library which is available in several popular programming languages: PHP, Java, ASP.NET (C#), Python (for Django) for server-side detection, and JavaScript for more limited client-side detection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top