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.