From 2c28ea21a6114f47ac73161045f3684607c89265 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 11 Apr 2021 09:02:01 +0300 Subject: Use HTTP_HOST if SERVER_NAME is localhost --- config.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'config.php') diff --git a/config.php b/config.php index eaaa132..3f930b1 100644 --- a/config.php +++ b/config.php @@ -7,10 +7,14 @@ $config = array( 'password' => 'red' ), 'urls' => array( - 'base' => 'http://localhost:8080' + 'base' => 'http://' . $_SERVER['SERVER_NAME'] ) ); +if($config['urls']['base'] == 'http://localhost') { + $config['urls']['base'] = 'http://' . $_SERVER['HTTP_HOST']; +} + define("LIBRARY_PATH", realpath(dirname(__FILE__) . '/library')); define("TEMPLATES_PATH", realpath(dirname(__FILE__) . '/templates')); -- cgit v1.2.1