Advertisement
mattada

mobile user agent redirect

Jan 27th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. <?php
  2. $iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
  3. $android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
  4. $ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
  5.  
  6. if ($iphone || $android || $ipod == true)
  7. {
  8. header('Location: http://mobile.site.com/');
  9. }
  10. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement