Mobile_detect php redirecting to subdomain - Stuck in a redirect loop!
Presumably your hook_init runs on both domains.

You need to check you're not already on the redirected page prior to redirection.

e.g

/**
 * Implements hook_init
 */
function mobydetect_init() {
  if($_SERVER['HTTP_HOST'] != 'm.mysite.com'){
    include("PATH/TO/Mobile_Detect.php");
    $detect = new Mobile_Detect();
    if ($detect-&gt;isMobile()) {
      drupal_goto('http://m.mysite.com', array('absolute' =&gt; TRUE, 'external' =&gt; TRUE));
    }
  }
}


Note, hook_init doesn't run on cached pages so you may find mobile users aren't redirected on cached pages. You could try using hook_boot instead or else offload to the webserver conf.