From 458a92a388d338b7ec8d3f98d5094d2a557eb239 Mon Sep 17 00:00:00 2001 From: Kang Cahya Date: Fri, 18 Jun 2021 09:28:11 +0700 Subject: [PATCH] url --- application/config/config.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index dbf47cc..aea6d2f 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -24,9 +24,13 @@ | */ // $config['base_url'] = ''; -$http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://'; +/* $http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://'; $newurl = str_replace("index.php","", $_SERVER['SCRIPT_NAME']); -$config['base_url'] = "$http" . $_SERVER['SERVER_NAME'] . "" . $newurl; +$config['base_url'] = "$http" . $_SERVER['SERVER_NAME'] . "" . $newurl; */ + +$root=(isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST']; +$root.= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); +$config['base_url'] = $root; /* |--------------------------------------------------------------------------