Php Codeigniter路由在子文件夹中不工作
我有一个使用Codeigniter的应用程序Php Codeigniter路由在子文件夹中不工作,php,codeigniter,Php,Codeigniter,我有一个使用Codeigniter的应用程序 在我的文件夹里 前/ admin/players/players.php players是/admin中的文件夹,player.php是我的控制器 当我试图访问以下网址,我得到404错误 在routes.php中,我定义了 $route['default_controller'] = "admin/login"; $route['admin/players'] = "admin/players/players"; $route['404_o
在我的文件夹里 前/
admin/players/players.php players是/admin中的文件夹,player.php是我的控制器 当我试图访问以下网址,我得到404错误 在routes.php中,我定义了
$route['default_controller'] = "admin/login";
$route['admin/players'] = "admin/players/players";
$route['404_override'] = '';
但它显示404错误。您能找到问题所在吗?这是您的全部控制器代码吗
class Players extends CI_Controller { function __construct() { parent::__construct(); } }
如果是这样,则缺少index(){}
函数
localhost/mysite.com/admin/players
正在重定向到localhost/mysite.com/admin/players/players
与localhost/mysite.com/admin/players/players/index
分解您的段,这意味着您需要在“/admin/players”目录中有一个控制器“players.php”,这个控制器需要一个“index”函数。这是您的全部控制器代码吗
class Players extends CI_Controller { function __construct() { parent::__construct(); } }
如果是这样,则缺少index(){}
函数
localhost/mysite.com/admin/players
正在重定向到localhost/mysite.com/admin/players/players
与localhost/mysite.com/admin/players/players/index
分解你的段,这意味着你需要在“/admin/players”目录中有一个控制器“players.php”,这个控制器需要一个“index”函数。你是如何编写players.php的类定义的?你能把它的前几行发出去吗?players.php还有players()函数吗?类players扩展了CI_控制器{function}uuuu construct(){parent::uuu construct();}}它有players()函数吗?我现在添加了它并检查了它。但是它仍然显示404错误。如果您简单地转到:如何编写players.php的类定义?你能把它的前几行发出去吗?players.php是否也有players()函数?类players扩展了CI_控制器{function}uuuu construct(){parent::uuu construct();}}它有players()函数吗?我现在添加了它并进行了检查。但它仍然显示404错误。如果您只需转到: