$base_url and $THEME_ARRAY using together I have this in settings.php:

$THEME_URLS = array(
  array('/optoelectronics','sky'),
);
foreach ($THEME_URLS as $info) {
  if (strpos($_SERVER['REQUEST_URI'], $info[0]) === 0) {
    $conf['theme_default'] = $info[1];
  }
}


I have two domains each based on a different theme. The issue is that I'm trying to use part of the old theme for just these two sections but the other theme is entirely based on SKY and if I make any modifications to the css or create a page-optoelectronics.tpl.php, then both sites receive the modifications, which I don't want.

So I duped the theme "sky" and changed all appropriate names and such to 'optotemp' but as I mention above, Drupal still disregards the "http://www.site.com" part and switches to 'optotemp' when it sees /optoelectronics.

So I found $base_url which returns the full path, including the host.

I'm a little rusty with the combination of an if/else command and including the array above in one fell swoop.

I want to say: If the absolute path is http://www.sitea.com/optoelectronics use theme optotemp. Otherwise, use the default theme. This command would then mean by default that http://www.siteB.com/optoelectronics would still use the theme assigned to that domain via the domain access module, which is Sky.

In other words, www.sitea.com has a new entire theme, but two sections of www.sitea.com will need to use optotemp but www.siteb.com uses sky.

I need help on knowing the syntax to get this right.

var $usOrEuro = $base_url;
if ($usOrEuro == 'http://www.sitea.com/optoelectronics'){
  $appliedTheme = 'optotemp';
}

$THEME_URLS = array(
  array($usOrEuro, $appliedTheme),
);
foreach ($THEME_URLS as $info) {
  if (strpos($_SERVER['REQUEST_URI'], $info[0]) === 0) {
    $conf['theme_default'] = $info[1];
  }
}
This should do it:

$hosts = array('sitea.com', 'www.sitea.com');
if (in_array($_SERVER['HTTP_HOST'], $hosts) &amp;&amp; $_SERVER['REQUEST_URI'] == '/optoelectronics') {
  $conf['theme_default'] = 'optotemp';
}