前台原URL:https://www.miyuwu.com/index.php/list,目标效果https://www.miyuwu.com/list
后台原URL:https://www.miyuwu.com/admin.php/list,目标效果https://www.miyuwu.com/admin/list
1、增加入口文件
在public目录下新建后台入口文件admin.php,可以直接复制index.php
2、修改index.php
$response = $http->run(); 改成 $response = $http->name('index')->run();
3、配置nginx
location / {
index index.php index.html error/index.html;
#隐藏index.php
if ( !-e $request_filename) {
rewrite ^/admin/(.*)$ /admin.php/$1 last;
rewrite ^/(.*)$ /index.php/$1 last;
}
}
4、重启nginx
搞定~
最后
以上就是沉默大山最近收集整理的关于nginx下tp6多应用URL隐藏php入口文件的全部内容,更多相关nginx下tp6多应用URL隐藏php入口文件内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复