I can't login using the mobi theme/loader. I needed to change the mobi module to use 'm.MYSITE.net' instead of 'MYSITE.mobi' using this code:

function mobi_loader_init() {
  if (isset($_SERVER['HTTP_HOST'])) {
    //if (substr($_SERVER['HTTP_HOST'], strrpos($_SERVER['HTTP_HOST'], '.')) == '.mobi') {
    if ($_SERVER['HTTP_HOST'] == 'm.MYSITE.net') {
      global $conf;
      $conf['theme_default'] = 'mobi';

This works OK, but certain things that seem to use 'drupal_goto' redirect to 'MYSITE.net' (login, privatemsg 'inbox', for instance). I've tried using a conditional base_url setting like this (in settings.php):

//$base_url = 'MYSITE.net';  // NO trailing slash!
if($_SERVER["SERVER_PORT"] == 443){
  if($conf['theme_default'] == 'mobi' ){
   $base_url = 'https://m.MYSITE.net';
  }else{
   $base_url = 'https://MYSITE.net';
  }
} else {
  if($conf['theme_default'] == 'mobi' ){
    $base_url = 'http://m.MYSITE.net';
  }else{
    $base_url = 'http://MYSITE.net';
  }
}

I'm also using some working apache2 rewrite rules for SSL, btw, which explains the extra conditional base_url statements... The above code (to which I added the mobi check) has no impact. Upon submitting the login page it seems to take, but I end up at MYSITE.net (instead of m.MYSITE.net) everytime, and not logged in. Browsing using the mobi theme works though. I also tried disabling the apache rewrite rules entirely, and the same problem was there.

Any help would be appreciated. I'll be sure to post the fix here once found.

.

CommentFileSizeAuthor
#1 mobi_loader_config.png10.02 KBdeekayen

Comments

deekayen’s picture

Project: .mobi » .mobi loader
Version: 5.x-1.1 » 6.x-1.x-dev
Status: Active » Fixed
StatusFileSize
new10.02 KB

The loader now lets you set the mobile domain through config.

mobi_loader_config.png

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.