redirect all unknown browsers to mobile
fr3em1nd
✭✭
Hi,
how can i accomplish to redirect users directly to mobile view if they have unknown useragents/browser ? on my case i have alot of users using different sorts of browsers.
0
Comments
here is some good info on device detection and user agents
http://code.google.com/p/php-mobile-detect/wiki/Mobile_Detect
if ($detect->isMobile()) {then some code about browsers or devices types}
but I'm new to this so can't tell you how to do it , I need to learn more on my own before I can be certain how to do it for sure, this is just a guess but the info looks good.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
you could also use java script to do it I think
var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function() { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function() { return navigator.userAgent.match(/IEMobile/i); }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); } };❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
To check to see if the user is on any of the supported mobile devices
if( isMobile.any() ) alert('Mobile');
if( isMobile.iOS() ) alert('iOS');
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌