We have implemented a multidomain portal using domain access module. Now we would like to setup a mobile site for each domain added.

Initially we thought about going for responsive layout, but as the mobile portal has very simple layout with minimum elements, using responsive model might be an overkill as it load every html elements to mobile even if most of the elements are not used in mobile theme. Also there are few features/blocks like slider etc implemented differently in mobile theme.

The m.domain and separate theme for mobile site looks like a feasible solution. But I am not sure what would be the best way to integrate it with domain access.

We want all content in the desktop domain available in the mobile domain, only theme need to be changed. It would be good if we were able to setup a domain alias where we can provide the m.domain.com in the configuration for the main domain and use the same access control as main domain, only change will be the theme and the links rel="alternate" and rel="canonical"

Also we need to setup a http redirection when a user visit the site from a mobile device. (Any suggestion for switching back to the desktop theme from mobile device and vice versa)

Is there any way to implement something like this using domain access?

2 Answers 2


You need these two modules to do this:

https://www.drupal.org/project/simple_mobile_redirect (detects mobiles and redirects them to pre configured paths) &

https://www.drupal.org/project/themekey (serves any theme (e.g. a customized mobile theme) under any pre configured path)

  • If we use domain access, then themekey is not required as the domain access module itself supports separate themes for each domain. Will check simple_mobile_redirect.
    – Vimal
    Dec 2, 2014 at 15:32

We have finally decided to go with the domain access for the separate m. website.

  1. We have to create a domain variable to map the primary domain and its mobile domain
  2. Assign all the content added from the primary domain to the corresponding mobile domain also. - This can be done programatically on node save.
  3. Need to follow the standard practices for the mobile sites with separate urls. Here is a good documentation regarding what all need to be taken care of when we create a mobile site with different URL - https://developers.google.com/webmasters/mobile-sites/mobile-seo/configurations/separate-urls
  4. Implement a UserAgent based mechanism in javascript/JQuery for redirecting the users access the site from a mobile device to m. website.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.