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



声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:52
阅读量:111
阅读量:132
阅读量:96
阅读量:113