From df9914b124a1f60ea9db4a7c534cff4111d4ae56 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 19 Jan 2015 12:03:51 -0500 Subject: [PATCH] One more try to get the base url define correct. --- index.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 90cf4af0..c70a5ec1 100644 --- a/index.php +++ b/index.php @@ -46,6 +46,13 @@ * */ +// Determine current http/https protocol +$pageProtocol = 'http'; +if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') { + $pageProtocol = 'https'; +} +define('GLM_MEMBERS_PLUGIN_HTTP_PROTOCOL', $pageProtocol); + // Debug Options define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG', true); define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE', true); @@ -58,11 +65,8 @@ define('GLM_MEMBERS_PLUGIN_DB_VERSION', 0.1); // URLs define('GLM_MEMBERS_PLUGIN_URL', plugin_dir_url(__FILE__)); -$pageProtocol = 'http'; -if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') { - $pageProtocol = 'https'; -} -define('GLM_MEMBERS_PLUGIN_CURRENT_BASE_URL', $pageProtocol.'://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']); +$pageUri = explode('?', $_SERVER['REQUEST_URI']); // Bust this up to access URL path and script name only +define('GLM_MEMBERS_PLUGIN_CURRENT_BASE_URL', $pageProtocol.'://'.$_SERVER['SERVER_NAME'].$pageUri[0]); // Directories define('GLM_MEMBERS_PLUGIN_NAME', 'Gaslight Media Members Database'); -- 2.17.1