Php – unable to load your default controller on Codeigniter

codeigniterPHProutes

This is the error that i am getting.

Please make sure the controller specified in your Routes.php file is valid.

Let me explain this.
In my application i have used HMVC. In my application folder there are two folders back-modules and front-modules.in my front-modules folder there is a folder called "home" and it has controllers,modules and views.

controllers->home.php

this is my home.php

  class Home extends MX_Controller{
    public function __construct(){
    parent::__construct();
    $this->load->helper(array('form'));
  }

    public function index(){                
    $this->template->build('home');
   }
  }

and this is my routes.php

$route['default_controller'] = "home";
$route['404_override'] = '';

when i try to go to the site, it gives this error

unable to load your default controller on Codeigniter.Please make sure the controller specified in your Routes.php file is valid.

this system works fine on localhost.

Someone please help me in this matter.

Best Answer

Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. The segments in a URI normally follow this pattern:

example.com/class/function/id/

your 'default_controller' should be:

$route['default_controller'] = "home/index";

read official CodeIgniter URI Routing Documentation

Related Topic