diff --git a/res/router.php b/res/router.php index 85efde17a..6a7376bd2 100644 --- a/res/router.php +++ b/res/router.php @@ -34,7 +34,10 @@ $html = str_replace('', $script."\n".'', $html); } // replaces base url by localhost - $html = str_replace(trim(file_get_contents($_SERVER['DOCUMENT_ROOT'].'/../.phpoole/baseurl')), 'http://localhost:8000/', $html); + $baseurl = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'].'/../.phpoole/baseurl')); + if (false !== strstr($baseurl, 'http') || $baseurl != '/') { + $html = str_replace($baseurl, 'http://localhost:8000/', $html); + } echo $html; return true;