问题
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