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
index.php
like so:

/*

*---------------------------------------------------------------
* APPLICATION FOLDER NAME
*---------------------------------------------------------------
*
* 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
*
* NO TRAILING SLASH!
*
*/
$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

<?php
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