Default Function ( index() ) for Controller Not Found |
[eluser]beneck[/eluser]
I have been continually having a problem with the index() method not being found even thought it is present. I must explicitly type the class and function name in. In the Code Igniter Manual it says this.... Quote:example.com/index.php/blog However, I am having trouble getting this to work. I have a class named "Ben" Code: class Ben extends CI_Controller { When I type in mysite.com/index.php/ben/index it works just fine. However, per the manual, if I try it without the index mysite.com/index.php/ben it does not work and I get a "Page Not Found" error. My config file looks like this. Code: /* Any thoughts on why this isn't working? PLEASE NOTE I know I can get this ONE INSTANCE to work with a custom route. However, the problem is figuring out why the built in functionality is not working right. This is a problem as NONE of my controllers index functions are being found and I don't want to have to make dozens of custom routes just to solve a problem that is supposed to be built into the software in the first place. I would appreciate any help on what might be going on.
[eluser]beneck[/eluser]
SOLVED I had a thought after I posted this and I can't delete this topic now. It was user error. I had made a custom router MY_Router.php (which was fine). However, prior to that I edited the core Router.php file to try and convert all hyphens to underscores. I broke the Router file. I just copied a fresh download (making sure it was the same version) over the old file and it fixed the problem. Also, I solved my hyphen to underscore problem with some HTACCESS code. Live and learn. |
Welcome Guest, Not a member yet? Register Sign In |