• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
not sure why my controller is getting called

Here is my route for the controller:

$route['gotopage'] = 'general/gotopage';

The controller file is located here:


Here is the code in the controller file:


if (!defined('BASEPATH'))  
    exit('No direct script access allowed');

class Gotopage extends CI_Controller
    public function __construct()  
    public function index()

for some reason codeigniter is throwing the 404 page not found error.

I have no idea what I'm doing wrong...

have you create the views for index.php ?

yes i have. and teh file is called index.php and is in the views directory.


Your route is saying "if the request is for /gotopage, send it to the general controller/gotopage method".

So, you're sending the request to the "general" controller, which doesn't exist.

ok...so how should i correct my routes, directories, files, class names?

Your example should be okay - it should find the controller in the subdirectory just fine. Can you access the general/gotopage controller directory (without routes)? Verify that you can do that first.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.