From 544af2871dafd38c815dc67f8ad83e6e47ff2a17 Mon Sep 17 00:00:00 2001 From: Ianthe Sutherland Date: Thu, 14 Aug 2014 15:17:54 +0100 Subject: [PATCH] LIB001-865: Handling www. in hostnames to find config files --- application/controllers/skylight.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/controllers/skylight.php b/application/controllers/skylight.php index d842cbfc..0a12cca9 100644 --- a/application/controllers/skylight.php +++ b/application/controllers/skylight.php @@ -172,6 +172,12 @@ function _load_site_config() { // remove test. $hostname = substr($hostname, 5); } + // strip out the www if it's there + else if(strpos($_SERVER['HTTP_HOST'], "www.") !== false) { + // will be www.hostname + // remove www. + $hostname = substr($hostname, 4); + } // else just use the hostname }