?php $agent = $_SERVER['HTTP_USER_AGENT']; //Work out the UA $android = false; $ios = false; //Android if (stripos($agent, 'android')!==false){ //Could be Android, however Edge on Windows Phone 10 also includes this if (stripos($agent, 'linux')!==false){ //Chrome, Android browser, & Opera $android = true; } elseif (stripos($agent, 'firefox')!==false){ //Firefox $android = true; } } //iOS if (stripos($agent, 'ipad')!==false || stripos($agent, 'iphone')!==false){ if (stripos($agent,'like Mac OS X')!==false){ $ios = true; } } $header = 'https://riide.co'; //Perform Redirects if ($android){ $header = 'market://details?id=uk.riide&hl=en_GB'; } elseif ($ios){ $header = 'itms-apps://itunes.apple.com/app/id1131008247'; } header('Location: '.$header); exit;