From 1754e6cf816a53e163a24217e9906cc7c40df38b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 30 Sep 2008 03:28:50 +0000 Subject: [PATCH] Reverted r63388 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63389 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/Director.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/control/Director.php b/core/control/Director.php index 92df053b4..0f17e8018 100644 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -503,14 +503,13 @@ class Director { * Force a redirect to a domain starting with "www." */ static function forceWWW() { - if(!Director::isDev() && !Director::isTest() && strpos($_SERVER['SERVER_NAME'], 'www') !== 0) { - if(!empty($_SERVER['HTTPS'])) { - $destURL = str_replace('https://', 'https://www.', Director::absoluteURL($_SERVER['REQUEST_URI'])); - } else { - $destURL = str_replace('http://', 'http://www.', Director::absoluteURL($_SERVER['REQUEST_URI'])); - } + if(!Director::isDev() && !Director::isTest() && strpos( $_SERVER['SERVER_NAME'], 'www') !== 0 ){ + if( $_SERVER['HTTPS'] ) + $destURL = str_replace('https://','https://www.',Director::absoluteURL($_SERVER['REQUEST_URI'])); + else + $destURL = str_replace('http://','http://www.',Director::absoluteURL($_SERVER['REQUEST_URI'])); - header("Location: $destURL", true, 301); + header("Location: $destURL"); die("

Your browser is not accepting header redirects

Please click here"); } }