Welcome Guest, Not a member yet? Register   Sign In
404 error for controller
#1

[eluser]Wonder Woman[/eluser]
Hi,

I hope someone can help. I have a controller called news and I just want to display the index function page but it throws a 404 error...the edit one works perfectly. I have two other controllers and they both work with the same code...

So if I go to "..admin/news" it doesn't work but if I do "..admin/news/edit/1" it works??

Code:
class News extends CI_Controller {

   function __construct()
   {
      parent::__construct();
      $this->load->model('admin/news_model');
      $this->load->library('form_validation');
      $this->load->library('session');        
   }

   function index()
   {        
      $this->load->view('admin/manage');
   }

   function edit()
   {
      // other code is in here but this works fine
      $this->load->view('admin/edit');
   }    
}

If you could help me out that would be great, thanks.
#2

[eluser]osci[/eluser]
Do you happen to have an admin controller?

is admin/news/index working?
#3

[eluser]Wonder Woman[/eluser]
Ooh yes admin/news/index is working...how do I fix this? Thanks for a speedy response btw Smile
#4

[eluser]Wonder Woman[/eluser]
I think I have found the problem! I looked in my routes.php file and found this line which I forgot to delete:

Code:
$route['admin/news'] = 'admin/news_manager/index';

And I do have an admin controller, thanks for bringing it to my attention, I wouldn't have checked my routes.php file otherwise Smile




Theme © iAndrew 2016 - Forum software by © MyBB