Advertisement
Guest User

redirect123

a guest
May 30th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. REDIRECT MOBILE
  2.  
  3. <script>
  4. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
  5. window.location.href=&quot;bleh&quot;;
  6. }
  7. </script>
  8.  
  9. <script> window.top.location=&quot;bleh&quot;;
  10. </script>
  11.  
  12.  
  13.  
  14. REDIRECT COUNTRY
  15.  
  16. <?php
  17. // ccr.php - country code redirect
  18. require_once('geoplugin.class.php');
  19. $geoplugin = new geoPlugin();
  20. $geoplugin->locate();
  21. $country_code = $geoplugin->countryCode;
  22. switch($country_code) {
  23. case 'US':
  24. header('Location: http://www.domain.com/links/usa.php');
  25. exit;
  26. case 'CA':
  27. header('Location: http://www.domain.com/links/canada.php');
  28. exit;
  29. case 'GB':
  30. header('Location: http://www.domain.com/links/greatbritain.php');
  31. exit;
  32. case 'IE':
  33. header('Location: http://www.domain.com/links/ireland.php');
  34. exit;
  35. case 'AU':
  36. header('Location: http://www.domain.com/links/australia.php');
  37. exit;
  38. case 'NZ':
  39. header('Location: http://www.domain.com/links/newzealand.php');
  40. exit;
  41. default: // exceptions
  42. header('Location: http://www.domain.com/links/allelse.php');
  43. exit;
  44. }
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement