Codeigniter controller not found

I think there might be problem with .htaccess file. Do you have .htaccess file in your main project directory and is that written like following ?? If not make that so..

 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.+)$ index.php/$1 [L]

Your issue may be due to any of the following reason

  • First letter of your controller file name should be in capital letter ie Home.php .
  • Please check your home page file name
  • Use the URL localhost/w3crud/index.php/home/you if the issue is in your url then edit your .htaccess file

While thinking about this problem I wonder this might happened to starters like me Suppose we have the project in a folder named codeigniter. so when typing the url we type something like this localhost/codeigniter/ and it shows the welcome message.But it automatically adds index.php defined in config.php (line 38) after the url like this localhost/codeigniter/index.php. So if you don't have mod_rewrite written in .htaccess file don't worry, try this url

localhost/codeigniter/index.php/home/you

in your case home.php is the controller file and you is the method here