Skip to content

Commit

Permalink
#804 - Set live_site as base_path
Browse files Browse the repository at this point in the history
  • Loading branch information
johanjanssens committed Oct 19, 2021
1 parent 295d794 commit 7d464b2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions code/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function _initialize(KObjectConfig $config)
'cache_path' => $config->cache_path ? $config->log_path : $config->site_path.'/cache',
'extension_path' => $config->extension_path ? $config->extension_path : $config->site_path.'/extensions',
'debug' => JFactory::getConfig()->get('debug'),
'base_path' => $config->base_path ?? null,
'base_path' => $config->base_path ?? JFactory::getApplication()->getCfg('live_site'),
'url_prefix' => $config->url_prefix ? trim($config->url_prefix, '/') : basename($_SERVER['SCRIPT_NAME']),
))->append(array(
'page_cache' => true,
Expand Down Expand Up @@ -89,13 +89,9 @@ public function getSitePath($path = null)
public function getUrlPrefix()
{
//Handle Joomla context
if(JFactory::getApplication()->getCfg('sef_rewrite') || JFactory::getApplication()->getCfg('live_site'))
if(JFactory::getApplication()->getCfg('sef_rewrite'))
{
$path = '';
if($base = JFactory::getApplication()->getCfg('live_site')) {
$path .= $base;
}

if(!JFactory::getApplication()->getCfg('sef_rewrite')) {
$path = !empty($path) ? $path.'/index.php' : 'index.php';
}
Expand Down

0 comments on commit 7d464b2

Please sign in to comment.