I work on multilingual site by domain like http://www.mydomain.com for english and http://www.mydomain.fr for french (default language)

When i make a search through search block in english site, i'm redirected to http://www.mydomain.comhttp//www.mydomain.com/search/node/mysearchstring

In custom_search.module, line 389, $GLOBALS['base_root'] and url() both return http://www.mydomain.com. So i have my double domain name in url.

// Generate the base url for redirection
  $base_redirect = $GLOBALS['base_root'] . url();

I make a patch to resolve this (only check if $GLOBALS['base_root'] and url() are equals but we could add i18n module_exists and other options too) adding test on base_root and url() :

  // Check if url() is not already the base_root (in multilingual domain case)
  if(preg_match('/^'.str_replace('/', '\\/', $GLOBALS['base_root']).'/', url()) == TRUE){
    $base_redirect = url();
  }

Patch in next comment

Comments

goz’s picture

Status: Active » Closed (fixed)

No needs patch anymore, i saw the 6.x-1.x-dev version resolve this problem on a nice way and works fine