Created
February 12, 2016 04:29
-
-
Save gwijayas/f43281ef36012332a79d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function Redirect($url, $permanent = false) { | |
if (headers_sent() === false) | |
{ | |
header('Location: ' . $url, true, ($permanent === true) ? | |
301 : 302); | |
} | |
exit(); | |
} | |
require_once './Mobile_Detect.php'; | |
$detect = new Mobile_Detect; | |
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : | |
'phone') : 'computer'); | |
if ($deviceType!='computer') { | |
Redirect("http://search.uyora.com",false); | |
die(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment