ThinkPHP隐藏模块后其他模块访问不了怎么处理
1、首先,只有一个入口文件index.php。正常情况下都可以访问
后台:http://localhost/my_tp5/admin/index/admin_index
前端:http://localhost/my_tp5/index/index/my_index



2、现在在入口文件index.php上绑定模块,只允许访问后台模块。
添加代码:define('BIND_MODULE','admin');
可以访问后台且隐藏了模块名:http://localhost/my_tp5/index/admin_index
访问前端报错:http://localhost/my_tp5/index/index/my_index



3、解决办法:
1、复制一个入口文件index.php命名为:admin.php ;
2、在admin.php添加代码:define('BIND_MODULE','admin');
3、index.php保持不变;
后台地址隐藏了模块名,不过多了个入口文件名:
http://localhost/my_tp5/admin.php/index/admin_index
前端:http://localhost/my_tp5/index/index/my_index



阅读量:47
阅读量:175
阅读量:54
阅读量:98
阅读量:153