CodeIgniter 404 Page Not Found, but why? CodeIgniter 404 Page Not Found, but why? codeigniter codeigniter

CodeIgniter 404 Page Not Found, but why?


The cause of the problem was that the server was running PHP using FastCGI.

After changing the config.php to

$config['uri_protocol'] = "REQUEST_URI";

everything worked.


You could try one of two things or a combination of both.

  1. Be sure that your controller's name starts with a capital letter. eg "Mycontroller.php"
  2. If you have not made any changes to your route, for some strange reason, you might have to include capital letters in your url. e.g if your controller is 'Mycontroller.php' with a function named 'testfunc' inside it, then your url will look like this: "http://www.yourdomain/index.php/Mycontroller/testfunc". Note the capital letter. (I'm assuming you haven't added the htaccess file to remove the 'index.php' part. If you have, just remove it from the url.)

I hope this helps someone


Leaving this answer here for others who ran into my situation.

My codeigniter app was working fine in localhost/WAMP, but was unable to route and produced 404 not found errors when pushing to an AWS EC2 instance. My issue was solved from the answer from HERE htaccess works in localhost but doesn't work in EC2 instance

(route to my admin page){domain}/admin was producing 404

the /etc/httpd/conf/httpd.conf file needs to be modified.

-after every instance of "DocumentRoot "/var/www/html"" (2 places) "AllowOverride None" needed to be changed to "AllowOverride All".

Restarted the EC2 instance from the AWS dashboard.

{domain}/admin is now accessible and working as intended.

hope this helps someone else like it helped me!