2

The app which i'm creating using codeigniter is loading on my localhost. But when i uploaded the same into cpanel its showing "404 Page Not Found".

I'm able to access default welcome controller other than this it shows 404 page not found.

Below are my configuration in application/config/config.php

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

.htaccess configurations are as follows

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

configuration in application/config/routes.php are as below

$route['default_controller'] = 'login';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

If I change the default_controller to welcome then welcome is loading fine.

--Thanks in advance

2
  • 4
    Make sure your controller's filenames are ucfirst Commented Oct 7, 2015 at 13:49
  • Thanks @AdrienXL. This fixed my problem Commented Oct 7, 2015 at 13:52

1 Answer 1

3

As said in the comments : Your controller's file name must start with an uppercase. See http://codeigniter.com/userguide3/changelog.html

Changed filenaming convention (class file names now must be Ucfirst and everything else in lowercase).

:-)

Sign up to request clarification or add additional context in comments.

1 Comment

This is only the case if you're using CodeIgniter 3.

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.