title: How to get Joomla installed domain
body: <p>I need to do custom redirect after login, but i'm not very familiar with the base of Joomla, so i'm did a little hardcode</p>
  
  <pre><code>$app-&gt;redirect(JRoute::_('http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/')).'/index.php?option=com_myapp'));
  </code></pre>
  
  <p>But in some cases there are problems, so is it possible somehow determinate what is the default joomla domain/url/path where it is installed so i could use something like <code>$domain.'/index.php?option=com_myapp'</code>?</p>
  
  <p>P.S.
  Using 2.5</p>