新增前端站点
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
location ~* (runtime|application)/{
|
||||
return 403;
|
||||
}
|
||||
location / {
|
||||
if (!-e $request_filename){
|
||||
rewrite ^(.*)$ /index.php?s=$1 last; break;
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user