summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-06-28 23:14:08 +0400
committerAndrew Dolgov <[email protected]>2012-06-28 23:15:09 +0400
commit955d4f82eaa4bef245597ae9e95e8b1d2880af41 (patch)
tree84a40706846f776ec49c6e8c6328bc903939a85f /index.php
parenteab6e8fb61694925cf3f15edc2bfadfc81cfca3e (diff)
automatically redirect to mobile/ using Mobile_Detect class
Diffstat (limited to 'index.php')
-rw-r--r--index.php8
1 files changed, 8 insertions, 0 deletions
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);