404 Page Not Found The page you requested was not found while new page created codeigniter

爱⌒轻易说出口 提交于 2021-01-28 19:47:23

问题


I have copied Model, View, Controller files to new Model/Controller/View with different filename in a codeigniter project. When I access the new page the below error is occurring:

404 Page Not Found

The page you requested was not found.


回答1:


if you copy (save as) a controller or model, there are several reasons why a

404, page not found error

may occur:

  • the file was not saved with a capital first letter
  • the class name was not updated
  • the class name was updated, but doesn't start with a capital first letter
  • in case of controller: the routing was not updated/included

for example, if a model's filename is MyModel.php, it needs to start with class MyModel extends CI_Model {}

see General Topics Controllers and Models




回答2:


it works fine now, Class names were not updated it have been updated now.



来源:https://stackoverflow.com/questions/63428108/404-page-not-found-the-page-you-requested-was-not-found-while-new-page-created-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!