In a muli-host environment, there would be several configuration file, each with the domain name.

For example, there would be mysite1.com.php and mysite2.com.php, and conf.php would be a symbolic link to the default site.

However, this only works if drupal is installed in the web server DocumentRoot of the hosting account. If drupal is installed in a subdirectory of this, this scheme does not work.

For example, your hosting account is: /home/mysite1/public_html.
You install drupal in /home/mysite1/public_html/drupal/

And in includes/mysite1.com.php, you set:

$base_url = "http://mysite1.com/drupal";

The following code in includes/common.inc normally works for a multi-host environment

$file = strtolower(strtr($_SERVER["HTTP_HOST"] . substr($uri, 0, strrpos ($uri, "/")), "/:", ".."));

However, this will cause $file to be set to: mysite.com.drupal, and since a file called mysite.com.drupal.php does not exist, drupal looks for the default (which is conf.php), and sets the domain to it (e.g. mysite2.com), which is not what we want.

To solve this problem, the above line should be changed to:

$file = strtolower($_SERVER["HTTP_HOST"]);

This will return: mysite1.com, and since mysite1.com.php file exists, things work as expected.

Comments

jose reyero’s picture

I think this is not a bug.

Your configuration files should be named 'mysite1.com.drupal.php' and 'mysite2.com.drupal.php'

Hope this helps