Commit bd724f4e authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Fixed up wwwroot generation to work properly in a subdirectory.

parent ee1709a7
......@@ -56,8 +56,7 @@ foreach (array('docroot', 'dataroot') as $path) {
if (!isset($CFG->wwwroot)) {
$proto = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
$CFG->wwwroot = $proto . $host . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])). '/';
//if (false !== strpos($_SERVER['REQUEST_URI'], 'admin')) {print_r($_SERVER);echo $CFG->docroot;echo $CFG->wwwroot;}
$CFG->wwwroot = $proto . $host . '/' . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])). '/';
}
// core libraries
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment