title: Joomla different default page based on URL for microsites
body: <p>I am building a template right now for a client that wants to have multiple microsites and one master site under one instance of joomla. I'm building it in Joomla, because that is what I know, so please don't suggest another CMS, and yes I know Drupal supports this inherently! So here is the skinny. Right now my template looks for a domain name from the template params and then compares that to the base URI and then sets the variables to be used throughout the templates. So the code looks like this...</p>
  
  <pre><code> //multisite configuration - determines which template params and menu module to display depending on the base URL
  $url = JURI::base();
  $primary = 'http://'.$this-&gt;params-&gt;get('site-domain').'/';
  $sub1= 'http://'.$this-&gt;params-&gt;get('domain1-domain').'/';
  $sub2= 'http://'.$this-&gt;params-&gt;get('domain2-domain').'/';
  $sub3= 'http://'.$this-&gt;params-&gt;get('domain3-domain').'/';
  $sub4= 'http://'.$this-&gt;params-&gt;get('domain4-domain').'/';
  $sub5= 'http://'.$this-&gt;params-&gt;get('domain5-domain').'/';
  if($url == $primary):
      $logo = $this-&gt;params-&gt;get('logo');
      $title = $this-&gt;params-&gt;get('site-title');
      $slogan = $this-&gt;params-&gt;get('site-slogan');
      $menu = '&lt;jdoc:include type="modules" name="menu" /&gt;';
  elseif($url == $sub1):
      $logo = $this-&gt;params-&gt;get('domain1-logo');
      $title = $this-&gt;params-&gt;get('domain1-title');
      $slogan = $this-&gt;params-&gt;get('domain1-slogan');
      $menu = '&lt;jdoc:include type="modules" name="menu-1" /&gt;';
  elseif($url == $sub2):
      $logo = $this-&gt;params-&gt;get('domain2-logo');
      $title = $this-&gt;params-&gt;get('domain2-title');
      $slogan = $this-&gt;params-&gt;get('domain2-slogan');
      $menu = '&lt;jdoc:include type="modules" name="menu-2" /&gt;';
  elseif($url == $sub3):
      $logo = $this-&gt;params-&gt;get('domain3-logo');
      $title = $this-&gt;params-&gt;get('domain3-title');
      $slogan = $this-&gt;params-&gt;get('domain3-slogan');
      $menu = '&lt;jdoc:include type="modules" name="menu-3" /&gt;';
  elseif($url == $sub4):
      $logo = $this-&gt;params-&gt;get('domain4-logo');
      $title = $this-&gt;params-&gt;get('domain4-title');
      $slogan = $this-&gt;params-&gt;get('domain4-slogan');
      $menu = '&lt;jdoc:include type="modules" name="menu-4" /&gt;';
  elseif($url == $sub5):
      $logo = $this-&gt;params-&gt;get('domain5-logo');
      $title = $this-&gt;params-&gt;get('domain5-title');
      $slogan = $this-&gt;params-&gt;get('domain5-slogan');
      $menu = '&lt;jdoc:include type="modules" name="menu-5" /&gt;';
  endif;
  </code></pre>
  
  <p>So now what i need to do is build a template parameter that determines what menu item ID is default menu item and then do a PHP header redirect. Since Joomla does not support multiple defaults, I need a work around to generate the necessary redirect URL. I am thinking by menu item id or alias as I dont want to be limited to a category or article type display. Unfortunately solving this is where my knowledge of PHP and Joomla fall short. Any help would be great.</p>
  
  <p>Thanks
  Sandra :)</p>