Search code examples
phphttp-status-code-404codeigniter-2

Cannot access any controllers but the default controller in Code Ignite


In Code Igniter, I am trying to access a method from the controller, but it gives me a 404 not found error. Maybe it is a problem with the .htaccess file or config?

My base url is set as:

$config['base_url'] = 'http://localhost/codeIgniter/';

I tried to access:

http://localhost/codeIgniter/pages/index

but it returned a 404 not found error.


Solution

  • you are missing index.php from url just after your project name

    try using this url:

    http://localhost/codeIgniter/index.php/pages/index