Answers for "How to Redirect Website to a Mobile Version when Accessed on a Mobile Device"

0

How to Redirect Website to a Mobile Version when Accessed on a Mobile Device

if (screen.width <= 800) {  window.location = "http://m.domain.com";}
Posted by: Guest on September-03-2020
0

How to Redirect Website to a Mobile Version when Accessed on a Mobile Device

<?php
 $iphone = strpos($_SERVER[‘HTTP_USER_AGENT’],”iPhone”);
 $android = strpos($_SERVER[‘HTTP_USER_AGENT’],”Android”);
 $palmpre = strpos($_SERVER[‘HTTP_USER_AGENT’],”webOS”);
 $berry = strpos($_SERVER[‘HTTP_USER_AGENT’],”BlackBerry”);
 $ipod = strpos($_SERVER[‘HTTP_USER_AGENT’],”iPod”);

 if ($iphone || $android || $palmpre || $ipod || $berry == true) 
 {
     echo “](https://s3.amazonaws.com/woocms.woorank.com/2020/05/poor-mobile-optimization.png”;
  }
 ?>
Posted by: Guest on September-03-2020

Code answers related to "How to Redirect Website to a Mobile Version when Accessed on a Mobile Device"

Browse Popular Code Answers by Language