Skip to content

Instantly share code, notes, and snippets.

@gwijayas
Created February 12, 2016 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwijayas/f43281ef36012332a79d to your computer and use it in GitHub Desktop.
Save gwijayas/f43281ef36012332a79d to your computer and use it in GitHub Desktop.
<?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