Michael Nares Michael Nares - 4 years ago 114
PHP Question

Unable to load your default controller - given solution doesn't work

I'm getting the same issue as unable to load your default controller on Codeigniter. I am trying to simply load my site, tripmatcher.herokuapp.com, and I get a 500 with that URL, and the

'Unable to load your default controller'
message when loading

The home folder for me is application/front, and within that there is a folder called index.html. This is defined as the home folder within
like so:


* If you want this front controller to use a different "application"
* folder then the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html
$application_folder = 'application/front';

I have also tried just specifying /index as the root, as well as home/index and home/index.html. I am strugging to work out what it is I am doing wrong.

My routes.php:

$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

Answer Source

Why you change the application folder path ?? It should be

$application_folder = 'application';

Assume your controller name is welcome. Then File name should be Welcome.php. And inside the file

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

class Welcome extends CI_Controller {


In routes (application/config/routes.php)

$route['default_controller'] = 'welcome';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download