My requirement was to detect the mobile devices from the drupal backend and redirect the user to the assigned URL. For this we needed to identify whether the user was accessing the site from a mobile device. For this we had to check the user agent string and compare that with the most common mobile devices. Then depending upon the condition we redirect the user to the corresponding URL.