https://esa.myweiju.cn/esa.myweiju.cn/Subdomain: esa.myweiju.cn Accept-Encoding: gzip, br, zstd, deflate Eagleeye-Traceid: 9b66a99f17701215949548783e X-Forwarded-For: 216.73.216.80 Cdn-Loop: esa;loop=1 User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) Host: esa.myweiju.cn Cookie: cdn_sec_tc=9b66a99f17701215928758154eb9a42985c73c3e8295c83ba4d5d1a0d0; acw_tc=9b66a99f17701215928758154eb9a42985c73c3e8295c83ba4d5d1a0d0; PHPSESSID=gsc61147c9eh2o98ri5e2611cu Connection: keep-alive Accept: */* Content-Length: Content-Type: */*Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)exit; ?> // 获取当前域名 /** * 移除域名后缀 - PHP 8.0+ 最优方案 function removeDomainSuffixOptimal($domain1, $suffix = '.cssimg.com') { return str_ends_with($domain1, $suffix) ? substr($domain1, 0, -strlen($suffix)) : $domain; } */ // 使用 //$domain = removeDomainSuffixOptimal($_SERVER['HTTP_HOST']); $siteRepo = new SiteRepository(); $site = $siteRepo->findByDomain($domain); if (!$site) { http_response_code(404); $log('warning', 'site_not_found', ['domain' => $domain]); if ($appDebug) { die("Site not found for domain: " . htmlspecialchars($domain)); } echo renderFriendlyErrorPage(404, '网站不存在', '您访问的网站 '.$domain.' 暂未开通或已关闭,请检查网址是否正确。'); exit; } // 5. Initialize Context Context::setSite($site); Context::setDomain($domain); // 6. Routing $router = new Router(); $router->dispatch();