From 955d4f82eaa4bef245597ae9e95e8b1d2880af41 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 28 Jun 2012 23:14:08 +0400 Subject: automatically redirect to mobile/ using Mobile_Detect class --- index.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index 80e3ebf9e..1ecf1f9f5 100644 --- a/index.php +++ b/index.php @@ -14,6 +14,14 @@ require_once "version.php"; require_once "config.php"; require_once "db-prefs.php"; + require_once "lib/Mobile_Detect.php"; + + $mobile = new Mobile_Detect(); + + if ($mobile->isMobile() && !$mobile->isTablet() && !$_REQUEST['mobile']) { + header('Location: mobile/index.php'); + exit; + } $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); -- cgit v1.2.3