From ef7b3ecdc379dbb5459b1e82976d60a308900a30 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 12 Sep 2005 19:31:16 +0200 Subject: option for setting baseurl #523 darcs-hash:20050912173116-7ad00-d342f7b065591097b19966e4650192d449a6039e.gz --- conf/dokuwiki.php | 1 + inc/init.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php index 6b8aee896..b7850d760 100644 --- a/conf/dokuwiki.php +++ b/conf/dokuwiki.php @@ -13,6 +13,7 @@ $conf['umask'] = 0111; //set the umask for new files $conf['dmask'] = 0000; //directory mask accordingly $conf['lang'] = 'en'; //your language $conf['basedir'] = ''; //absolute dir from serveroot - blank for autodetection +$conf['baseurl'] = ''; //URL to server including protocol - blank for autodetect $conf['savedir'] = './data'; //where to store all the files /* Display Options */ diff --git a/inc/init.php b/inc/init.php index 092d023c3..4b01a1240 100644 --- a/inc/init.php +++ b/inc/init.php @@ -176,6 +176,9 @@ function getBaseURL($abs=false){ //finish here for relative URLs if(!$abs) return $dir; + //use config option if available + if($conf['baseurl']) return $conf['baseurl'].$dir; + //split hostheader into host and port list($host,$port) = explode(':',$_SERVER['HTTP_HOST']); if(!$port) $port = $_SERVER['SERVER_PORT']; -- cgit v1.2.3