From: Chuck Scott Date: Mon, 19 Jan 2015 17:03:51 +0000 (-0500) Subject: One more try to get the base url define correct. X-Git-Tag: v1.0.0~77 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=df9914b124a1f60ea9db4a7c534cff4111d4ae56;p=WP-Plugins%2Fglm-member-db.git One more try to get the base url define correct. --- 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');