Closed gfazioli closed 11 years ago
In some server configurations (like linux with Cpanel and nginx) the method currentURL prepend the www. Use:
currentURL
www
function get_host() { if ($host = $_SERVER['HTTP_X_FORWARDED_HOST']) { $elements = explode(',', $host); $host = trim(end($elements)); } else { if (!$host = $_SERVER['HTTP_HOST']) { if (!$host = $_SERVER['SERVER_NAME']) { $host = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : ''; } } } // Remove port number from host $host = preg_replace('/:\d+$/', '', $host); return trim($host); }
Closed!!
In some server configurations (like linux with Cpanel and nginx) the method
currentURL
prepend thewww
. Use: