How do I Redirect viewers to Mobile Version of Our Website?

By a.portman ·
I am trying to redirect mobile browsers (iPhone,Android,Tablets) from our main site to the mobile version of our site.

After looking around I found the following code:


$detect = new Mobile_Detect();
if ($detect->isMobile() && isset($_COOKIE['mobile']))
$detect = "false";
elseif ($detect->isMobile())

I ran the mobile_detect.php demo and it detects mobile browsers, but when I try it out, it never makes the switch.

Any suggestions?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums