Cosmo
Cosmo

Reputation: 87

CodeIgnite Not Loading Default or any other Controllers on locahost

The default controller (the welcome page) is not loading nor any other controllers. I have made no additional changes apart from what is listed below:

Downloaded and installed CI version 2.1.4 on WAMP to this directory -> http://localhost/ci/ and after I set the config file element bellow:

$config['base_url'] = 'http://localhost/ci/';

And after that I set the .htaccess from Deny all to this:

RewriteEngine on
RewriteBase /ci/
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Any suggestions would be appreciated.

Thank you.

Upvotes: 0

Views: 65

Answers (3)

saurabh kamble
saurabh kamble

Reputation: 1549

There is no need to set your base url:

$config['base_url'] = ' ';


RewriteEngine on
RewriteCond $1 !^(index.php|images|css|js|robots.txt|favicon.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

Upvotes: 1

Cosmo
Cosmo

Reputation: 87

Thank you all for the efforts in helping me set up CodeIgniter version 2.1.4. It seems that the package I original downloaded was faulty. After deleting the directory and downloading the CI files again, everything works.

Upvotes: 0

Walid Ammar
Walid Ammar

Reputation: 4126

Try this .htaccess:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]

Upvotes: 0

Related Questions