Questions

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

Tags:
+
0 Votes
Locked

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

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:

<?php

include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if ($detect->isMobile() && isset($_COOKIE['mobile']))
{
$detect = "false";
}
elseif ($detect->isMobile())
{
header("Location:http://www.careersinstlouis.com");
}

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?