mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-05 01:01:17 +02:00
BUGFIX #3900: Fix Director::forceWWW()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80230 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
038d1ecec2
commit
56199e45e7
@ -595,7 +595,7 @@ class Director {
|
|||||||
* Force a redirect to a domain starting with "www."
|
* Force a redirect to a domain starting with "www."
|
||||||
*/
|
*/
|
||||||
static function forceWWW() {
|
static function forceWWW() {
|
||||||
if(!Director::isDev() && !Director::isTest() && strpos($_SERVER['SERVER_NAME'], 'www') !== 0) {
|
if(!Director::isDev() && !Director::isTest() && strpos($_SERVER['HTTP_HOST'], 'www') !== 0) {
|
||||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
|
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
|
||||||
$destURL = str_replace('https://', 'https://www.', Director::absoluteURL($_SERVER['REQUEST_URI']));
|
$destURL = str_replace('https://', 'https://www.', Director::absoluteURL($_SERVER['REQUEST_URI']));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user