mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
优化路由子域名支持
This commit is contained in:
@@ -177,7 +177,7 @@ class Route
|
|||||||
$root = Config::get('url_domain_root');
|
$root = Config::get('url_domain_root');
|
||||||
if(empty($root)) return;
|
if(empty($root)) return;
|
||||||
// 子域名配置
|
// 子域名配置
|
||||||
$domain = rtrim(rtrim($_SERVER['HTTP_HOST'], $root), '.');
|
$domain = rtrim(preg_replace('/'.preg_quote($root).'$/', '', $_SERVER['HTTP_HOST']), '.');
|
||||||
$domain = explode('.', $domain);
|
$domain = explode('.', $domain);
|
||||||
if (!empty($domain)) {
|
if (!empty($domain)) {
|
||||||
$subDomain = implode('.', $domain);
|
$subDomain = implode('.', $domain);
|
||||||
|
|||||||
Reference in New Issue
Block a user