0

I have a main website , I would like for users to connect to my sub domain , where my mobile page will be held.

please help

2 Answers2

0

You must check the user's agent and if it is a mobile device then redirect to the subdomain. You have got an example of how to do it in php in iamandrus response here:

Detect mobile browser

Regards

Community
  • 1
  • 1
0

New to all this but could you use something like

function isMobile() {
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
}

if isMobile() {
//show mobile site maybe in a redirect?
}

else{
//Show normal site
}
user1721230
  • 317
  • 1
  • 6
  • 19