新增前端站点

This commit is contained in:
2025-04-30 18:07:45 +08:00
parent b568aad8cc
commit 3a2c9281c1
21 changed files with 1268 additions and 52 deletions
+8
View File
@@ -0,0 +1,8 @@
location ~* (runtime|application)/{
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
+10 -1
View File
@@ -13,7 +13,16 @@
if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
return false;
} else {
$_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
// 检查是否访问后台路径
if (isset($_SERVER['REQUEST_URI']) && preg_match('#^/admin(/.*)?$#', $_SERVER['REQUEST_URI'])) {
// 将请求重定向到后台入口
$_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
$_SERVER["PATH_INFO"] = '/admin' . (isset($_SERVER["PATH_INFO"]) ? $_SERVER["PATH_INFO"] : '');
$_SERVER["REQUEST_URI"] = '/index.php/admin' . (isset($_SERVER["PATH_INFO"]) ? $_SERVER["PATH_INFO"] : '');
} else {
// 前端入口
$_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
}
require __DIR__ . "/index.php";
}
View File