From b848abdf3ba2461a602e329714bd068d25950dc8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 24 May 2016 18:48:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 378400d0..395e2f49 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -494,16 +494,16 @@ class Route $rules = self::$domain; // 开启子域名部署 支持二级和三级域名 if (!empty($rules)) { - if (isset($rules[HTTP_HOST])) { + if (isset($rules[$_SERVER['HTTP_HOST']])) { // 完整域名或者IP配置 - $rule = $rules[HTTP_HOST]; + $rule = $rules[$_SERVER['HTTP_HOST']]; } else { $rootDomain = Config::get('url_domain_root'); if ($rootDomain) { // 配置域名根 例如 thinkphp.cn 163.com.cn 如果是国家级域名 com.cn net.cn 之类的域名需要配置 - $domain = explode('.', rtrim(stristr(HTTP_HOST, $rootDomain, true), '.')); + $domain = explode('.', rtrim(stristr($_SERVER['HTTP_HOST'], $rootDomain, true), '.')); } else { - $domain = explode('.', HTTP_HOST, -2); + $domain = explode('.', $_SERVER['HTTP_HOST'], -2); } // 子域名配置 if (!empty($domain)) {