3

I understand that there is already I want to get a Mobile version of my drupal site working about setting up a mobile website, but I'm still having such a hard time figuring out what to do. I'm a newbie in web development in general. I was hoping that I'd get some more handholding here.

Basically I have a Drupal site up and running, e.g. http://example.com/fullsite/, and I want to set up a mobile site on http://m.example.com/fullsite.

I'm a Lunarpages customer, which uses LPCP (instead of CPanel). I've created the m.example.com subdomain for the mobile site, but I haven't created any redirection. Some CPanels apparently let me setup the redirection through it, but not LPCP.

Following the instructions on some random blog I found, I set up new folders in my Drupal's "sites" folder. My "sites" folder currently looks like the following:

  • public_html

    • fullsite

      • sites

        • default (and all its contents)
        • all (and all its contents)
        • mydomain.com.fullsite

          • settings.php (copied from default)
        • m.mydomain.com.fullsite

          • settings.php // copied from default, but with the theme_default line modified
    $conf = array(
      'site_name' => 'My Drupal site',
      'theme_default' => 'zen',
      'anonymous' => 'Visitor',
    );

I've also:

  1. installed Drupal's Mobile Tools,
  2. set the mobile url to http://m.mydomain.com/fullsite
  3. set the desktop url to http://mydomain.com/fullsite
  4. enabled "automatic redirection of the mobile user" under "redirection options"
  5. chosen a different node as frontpage for my mobile visitors under "additional settings"
  6. Under "Theme Switching", chosen "Switch theme based on the URL"



But accessing my site from my mobile device, here's what I'm seeing:

  • Going to m.mydomain.com/mysite = "Not found. The reqeuested URL /mysite/ was not found in the server"
  • m.mydomain.com/mysite/node/somenode = "Not found. The reqeuested URL /mysite/ was not found in the server"
  • mydomain.com/mysite = "Cannot open the page because too many redirects occurred".

Am I even on the right track here? Do I have to do a new Drupal install on my m.mydomain.com/mysite for this? I was under the impression that I could just get m.mydomain.com/mysite to get its data from the main drupal site, and display the contents with a mobile theme. Is this true?

I'm pulling my hair out over this (Well, not literally. I'm actually bald)! Any pointers will be greatly appreciated.

1

I think you are on the right track, but I think doing this as a true multi-site is overkill, and potentially the wrong idea.

Ideally, you want your desktop site and mobile site to share the same content. If you are not going to go down the route of just using mobile stylesheets, then I suggest using Domain Access to create the mobile site.

You can use this module to set up your mobile domain, and then create your content accessibility rules for what is visible where. When used in combination with Panels, you have great flexibility.

Mobile Tools let you choose your theme for a user and also shows up in panel selection rules, and domain tools lets you show/hide content for a particular user.

Note the issue log for Mobile Tools, though. I found a bug with how the ctools selection rules work, and have a patch on the issue that hasbn't been committed or commented on.

| improve this answer | |
0

Try to set a redirection towards the main domain (the site one) in your lunar panel. The mobile tools module will detect the agent and will switch the theme according to the agent detected.

You can install the Firefox Agent Switch module to simulate the agent detection.

I hope this help.

| improve this answer | |
0

Great question as I'm trying to get this up and running also. I'm not sure if the Mobile tools take care of this but I am under the impression you need to setup your sites.php file.

something like this maybe.

$sites = array(
  'mydomain.com.fullsite' => 'mydomain.com.fullsite',
  'm.mydomain.com.fullsite' => 'm.mydomain.com.fullsite',
);

Again I'm not sure if mobile tools is doing this for you, but might be worth a check.

I'll be watching this closely as if you get success I will follow the steps you've laid out.

| improve this answer | |
  • I'd keep you updated – 3lk4b0ng Oct 25 '11 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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