Commit 00fb5562 authored by George Popoff's avatar George Popoff

change base_url logic

parent 8ea37099
...@@ -23,9 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -23,9 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| a PHP script and you can easily do that on your own. | a PHP script and you can easily do that on your own.
| |
*/ */
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $config['base_url'] = APP_URL;
$config['base_url'] = $protocol . 'eterfund.ru/api/typos/cp/';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
......
...@@ -313,3 +313,10 @@ switch (ENVIRONMENT) ...@@ -313,3 +313,10 @@ switch (ENVIRONMENT)
* And away we go... * And away we go...
*/ */
require_once BASEPATH.'core/CodeIgniter.php'; require_once BASEPATH.'core/CodeIgniter.php';
/**
* Define APP_URL Dynamically
*
* Automatic base url
*/
define('APP_URL', ($_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . "://{$_SERVER['SERVER_NAME']}".str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment