CodeIgniter Forums
CI 2.0.2 - Controller not found, 404 found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI 2.0.2 - Controller not found, 404 found (/showthread.php?tid=41760)



CI 2.0.2 - Controller not found, 404 found - El Forum - 05-16-2011

[eluser]bhenbe[/eluser]
Hi all,

i try to update my cms made with CI 1.7.x to 2.0.2 and a strange problem occurs :

when i try to access to a controller, 404 appears. If i set the 404_override to a specific controller, then the controller is found, loaded and works perfectly.

So, controllers are not found by uri but loaded with the 404.

I don't know how to locate the problem so, if you need more informations about my dev, ask ;-)

Thanks for your help.


CI 2.0.2 - Controller not found, 404 found - El Forum - 05-17-2011

[eluser]bhenbe[/eluser]
So, i can't found a solution...

For example :

config/routes.php

Code:
$route['default_controller'] = 'page';

$route['page/(:num)/(:any)'] = 'page/index/$1';
$route['xmlsitemap/'] = 'xmlsitemap/index/';

$route['404_override'] = '';

controllers/page.php

Code:
class Page extends CI_Controller {

    public function __construct() {
        
        parent::__construct();
        
        $this->load->library('parser');
        
        $this->load->helper(array('url', 'html', 'gloo_form_helper'));

    }
    
    function index($id = 0, $url = '') { ...

With this, a 404 error occurs.

Now, if i set the 404_override :

Code:
$route['404_override'] = 'page';

Controller page is loaded and show the index function. It works perfectly.

How can i have a problem like this between the 2.0.0 version and the 2.0.2 ?

Thank you for your help.