Change page.tpl.php in a shared theme based on domain I keep finding snippets like this:

function MYTHEME_preprocess_page(&amp;$vars) {
  $alias_parts = explode('/', drupal_get_path_alias());

  if (count($alias_parts) &amp;&amp; $alias_parts[0] == 'mydirectory') {
    $vars['theme_hook_suggestions'][] = 'page__mycustomtemplate';
  }
}


But, what I'm trying to figure out is how to switch to a different page.tpl.php file entirely within the same theme when a domain is different.

So if I had:

http://www.example1.com/stuff AND

http://www.example2.com/stuff


Using domain access module and other rules, the content is slightly different for example1 than example2 but the paths are identical so I can't simply access arg[0].

The ham-fisted way is to dupe the theme, change the name and be on my way but I'm sure I'm not getting something...the actual basic page.tpl.php template has to be modified because of existing content at the same path but different domain.

On example1, there are no side bars for example so those regions are not in the .info file nor rendered but on example2, there are sidebars. However, since I want to apply an existing theme, I just thought I'd restructure the actual page.tpl.php file for example2 so as to keep the majority of css/jquery and custom html implemented into the theme.

Is this more trouble than just duping the theme, rename and make the changes there?
You could do aomething like this: 

function MYTHEME_preprocess_page(&amp;$vars)
{
    $domain = domain_get_domain();

    $vars["theme_hook_suggestions"][] = "page__" . $domain["domain_id"];
}


Feel free to explore what other values are in the $domain array and use it accordingly to make your theme suggestions as complicated as required. The above example is just to demonstrate injecting domain information.

There are developer notes on the Domain Access module as well which you may find useful