比如在一个项目中有前台与后台两个模块,需要使用不同的入口文件。同时希望前台使用默认的index.php的入口。
关键的配置如下:
if (!-e $request_filename) { rewrite /admin.php(.*)$ /admin.php$1 last; rewrite ^(.*)$ /index.php/$1; break; }
如果访问的后台入口文件就交给admin.php这个入口文件进行处理。其他情况交给index.php这个入口文件。
(完)
比如在一个项目中有前台与后台两个模块,需要使用不同的入口文件。同时希望前台使用默认的index.php的入口。
关键的配置如下:
if (!-e $request_filename) { rewrite /admin.php(.*)$ /admin.php$1 last; rewrite ^(.*)$ /index.php/$1; break; }
如果访问的后台入口文件就交给admin.php这个入口文件进行处理。其他情况交给index.php这个入口文件。
(完)