Mobile Device Detection Module

use tar -xvf mobiledevicedetection-6.x-0.1.tar to extract the archive.

The Mobile Device Detection module allows a site owner to handle the redirection of his users to his mobile site. This module does not a transformation of your site to a mobile version, but it assist you in handling the traffic to your mobile and desktop site. You can choose the most user friendly way of redirection your Visitors.

21/01/2009 v6.x-0.2 Fixed bug in detection of mobile and desktop url.
18/01/2009 v6.x-0.1 Initial module

Functionality & Configuration
The module must be configured properly before usage. Configuration can be done at /admin/settings/mobile-device-detection.

You can configure the handling of the method when detecting a client different than
the intended website:
- Do nothing, but provide a $_SESSION['mobile'] variable containing a boolean describing if the client is mobile or not ( 0 = not mobile, 1 = mobile). This variable is also created in the next methods.
- Automatic redirection of the user to the mobile site (in case he is visiting the desktop site with a mobile device) or to the desktop site (in case he is visiting the mobile site with a desktop device)
- Give a notification to the user informing him about a version of the site, optimized for his needs.

You have to configure the url of the mobile site and the desktop site. The module supports different subdomains (e.g. mobile:, desktop: or paths (e.g. mobile:, desktop:

You can configure how many times you wish to display the message if the user doesn't click on the notification.

You can personalize the notification messages.

Testing this module
If you want to test this module, you can use the User Agent Switcher extension for Firefox, Flock and Seamonkey. You can find the extension at The extension allows you to change the User Agent that is accessing the site. You can download a list with mobile user-agents from Since the module uses $_SESSION variables to store the client and the number of impressions, you will need to delete cookies each time you want to test the module!!

This modules is highly complementary to a number of methods to mobilize your site.
Some examples:
- create a new theme suitable for mobile devices and make a multisite installation. You can create a m.* or a *.mobi domain and use the $conf varialbe in the settings.php file to configure the theme.
- You can create a new mobile site withour reusing your existing drupal site, and redirect the user to that site
- You can use an adaptation engine such as or

This module uses Andy Moore's ( device detection code available at Please read the terms and conditions attached to his code before usage. The code is provided with this module in the 'mdd' directory.

The module was sponsored by