CodeIgniter: 404 Page Not Found on Live Server

I have been developing a small web application with CodeIgniter. After testing it out locally I went to put it on my web server to allow a couple other people test out some features. While navigating to the site I get: -

404 Page Not Found error page

When viewing it in my local machine everything loads up and runs perfectly.

This is what I uploaded to the public_html directory:

application directory
system directory
assets directory (my assets for the site)
index.php

All of those are in the public_html directory. Like I said, it does give me CodeIgniters 404 error page, so I do know it is at least seeing CodeIgniter. I also tried changing the $config['base_url'], in the config.php, to my URL. Same error when changing that or leaving it blank. I checked my routes, and all those seem correct. Everything also loads up just fine when navigating to it on my local machine.

I also am not using a .htaccess file at this time

Any suggestions on what I should try?
Thanks a lot!


Solution 1:

You are using MVC with OOPS Concept. So there are some certain rules.

1) Your class name (ie: controller name) should be start with capital Letter.

e.g.: your controller name is 'icecream'. that should be 'Icecream'

In localhost it might not be compulsory, but in server it will check all these rules, else it can't detect the right class name.

Solution 2:

Changing the first letter to uppercase on the file's name and class name works.

file: controllers/Login.php

class: class Login extends CI_Controller { ... }

The file name, as the class name, should starts with capital letter. This rule applys to models too.

https://www.codeigniter.com/user_guide/general/models.html