Fix #3270

Related: #3268, 4bdb66759c24c41fefec7952b12a0595a671eaa2
diff --git a/system/core/Config.php b/system/core/Config.php
index 18380a0..ee738d7 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -78,11 +78,8 @@
 		{
 			if (isset($_SERVER['HTTP_HOST']))
 			{
-				$base_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].'/';
-				if ( ! empty($_SERVER['DOCUMENT_ROOT']))
-				{
-					$base_url .= ltrim(str_replace('\\', '/', substr(FCPATH, strlen($_SERVER['DOCUMENT_ROOT']))), '/\\');
-				}
+				$base_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST']
+					.substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME'])));
 			}
 			else
 			{