Left to its own devices, drupal_bootstrap() will only load the "master" Drupal site. If you want to bootstrap a subsite, you can use drupal_override_server_variables():

define('DRUPAL_ROOT', '/path/to/drupal');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$variables['url'] = 'http://www.example.com/subsite1'; 
drupal_override_server_variables($variables);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

Comments

mithenks’s picture

I was able to bootstrap a subsite with the posted code, except that I had to add a '/' at the end of $variables['url']

define('DRUPAL_ROOT', '/path/to/drupal');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$variables['url'] = 'http://www.example.com/subsite1/'; 
drupal_override_server_variables($variables);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);