简体   繁体   中英

New Routes in Codeigniter - 404 Page Not Found

I am working on an existing project on CodeIgniter and there was a need to create new routes. Existing routes work correctly, but new ones give a 404 error. Even when I make a copy of the route and controller, I also get a 404 error.

    $route['offer/list'] = "offer/list_offers"; 
    $route['offer/list1'] = "offer/list_offerss"; 

Second is copy.

For an example.

路线

After you added the routes, always create the Controller after that and call the view.

在此处输入图像描述

Note: Don't use my $this->loadviews()... Use the default

$this->load->view('phpNameWithoutTheExtension');

I use $this->loadviews() because i have another libraries that controll the view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM