1

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;
0

2 Answers 2

2

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';
Sign up to request clarification or add additional context in comments.

8 Comments

So the welcome controller should be within the application folder itself, right?
sorry didn't get you
It should be in the application/controllers folder
At the moment it is application/controllers/welcome.php, is that the right place?
@MichaelNares happy to help
|
1

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 */

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.