Reputation: 401
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;
Upvotes: 1
Views: 1389
Reputation: 94
Just use
$application_folder = 'application'; /* or whatever you want */
Then when you want to configure the default controller you can edit application/config/routes.php
$route['default_controller'] = 'default_controller'; /* where default controller is the controller what you want be the default */
Upvotes: 1
Reputation: 38584
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';
Upvotes: 2