We have a mobile site at http://example.com/m. (For a variety of reasons, we couldn’t follow the convention of m.domain .com or www.domain.mobi, so we are stuck with this url at least for now.)

We are using the Theme Switching option in Mobile Tools --- we want it to switch the theme for pages like example.com/m/services, example.com/m/about, etc.

However, this results in Mobile Tools switching the theme for any url which starts with “m”.

For example, if a user (mobile or not) visits http://example.com/may, Mobile Tools is switching the theme for that page.

I even tried using http://example.com/m/ in Mobile URL option. (Note / at end.)

That didn’t work either. So I did a hack in mobile_tools.module.

I replaced
$pos = strpos($uri, preg_replace('{/$}', '', $longest_url));
with this
$pos = strpos($uri, $longest_url);
and that fixed the issue.

Any specific reason why you are stripping last slash(/)?

And by the way, Thanks for this great module.

Note: I am not using Automatic redirect option from mobile tools as it will not work as expected since I am using boost to cache our pages.
I have posted solution here. http://drupal.org/node/681396

Comments

vikramy’s picture

Version: 6.x-1.9 » 6.x-1.12
twom’s picture

Assigned: Unassigned » twom
Category: feature » bug
Status: Active » Needs work
Anonymous’s picture

Same thing in D7, but your workaround doesn't work for me.

minoroffense’s picture

Status: Needs work » Closed (won't fix)

Mobile Tools 1.x is no longer supported.