Michael Nares
Michael Nares

Reputation: 401

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;

Upvotes: 1

Views: 1389

Answers (2)

maulana satya
maulana satya

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

Abdulla Nilam
Abdulla Nilam

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

Related Questions