diff --git a/core/control/ContentController.php b/core/control/ContentController.php index 8d2f143e9..bc09a6346 100644 --- a/core/control/ContentController.php +++ b/core/control/ContentController.php @@ -85,8 +85,8 @@ class ContentController extends Controller { if($this->dataRecord && RootURLController::should_be_on_root($this->dataRecord) && !$this->urlParams['Action'] && !$_POST && !$_FILES) { $getVars = $_GET; unset($getVars['url']); - if($getVars) $url = "./?" . http_build_query($getVars); - else $url = "./"; + if($getVars) $url = "?" . http_build_query($getVars); + else $url = ""; Director::redirect($url); return; } diff --git a/core/control/Controller.php b/core/control/Controller.php index 2e7cfe12a..20ab8cfce 100644 --- a/core/control/Controller.php +++ b/core/control/Controller.php @@ -407,7 +407,7 @@ class Controller extends ViewableData { */ function redirect($url) { // Attach site-root to relative links, if they have a slash in them - if(substr($url,0,4) != "http" && $url[0] != "/" && strpos($url,'/') !== false){ + if($url == "" || $url[0] == '?' || (substr($url,0,4) != "http" && $url[0] != "/" && strpos($url,'/') !== false)){ $url = Director::baseURL() . $url; }