View Single Post
Old 07-16-2012, 10:00 PM   PM User | #2
kallejillheden
New to the CF scene

 
Join Date: Jul 2012
Location: Sweden / Sverige
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kallejillheden is an unknown quantity at this point
If you download this file and put it into your site and then put this into your index.php file:

It needs to end with .php or else the script won't work
PHP Code:
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect();
if(
$detect->isMobile() or $detect->isTablet()){
header("Location: http://m.yoursite.com/");

The script is not hard or complicated, if you reed it you would probably understand it clearly.

This will redirect any mobiles or tablets to your mobile version of your site.

More info on how you can use the Mobile_Detect.php file can be found here.

Important notes:
The file needs to be unzipped, and the content is going into your server.
The demo.php file is not necessary, only the Mobile_Detect.php file.
The Mobile_Detect.php file needs to be in the same directory as the file you put the script into.
kallejillheden is offline   Reply With Quote