Welcome Guest, Not a member yet? Register   Sign In
Unable to load default controller on 404 errors.
#11

[eluser]CroNiX[/eluser]
If you believe there is a bug, submit a bug report. That's how things get fixed.
#12

[eluser]sehummel[/eluser]
Will do.
#13

[eluser]Aken[/eluser]
[quote author="sehummel" date="1326908953"]I figured it out, thanks to you.

The var_dump showed me it was trying to load the folder name as the controller (misc/site_map => misc). Once I moved the site_map controller into the root of the controllers folder, it worked fine. Thanks, so so much![/quote]
I don't believe this is a bug based on what you said here. It sounds like you were putting your controller in a subdirectory, but were trying to access a standard controller URL.

Here's an example. Let's use that controller you just created:
Code:
class Misc extends CI_Controller
{
    public function __construct()
    {
         parent::__construct();  
    }
    
    public function site_map()
    {
          echo 'Not Found';
    }    
}

If you placed this file in your root controllers directory (application/controllers), the URL to access the site_map() function would be: example.com/misc/site_map

If you then created a folder in your controllers directory, called "misc", and moved your controller file into that directory, the URL for accessing the site_map() function would then change to: example.com/misc/misc/site_map

CodeIgniter does not automatically match the subdirectory to a controller file of the same name and then map it accordingly. It's just how the URL structures work - if CI did that, then people would probably get confused all the time. Again, it's not a bug, but a limitation or lack of a feature. You have to define a route to tell CI where to find any default pages inside subdirectories.

A couple of CI docs pages that might help make it more clear:
http://ellislab.com/codeigniter/user-gui.../urls.html
http://ellislab.com/codeigniter/user-gui...subfolders




Theme © iAndrew 2016 - Forum software by © MyBB