Tcmxc
Tcmxc

Reputation: 491

Why is my main controller not working in codeigniter

I am brand new to codeigniter but I have been a PHP developer for years.

A client of mine has a exciting codeigniter site that was developed my another developer and I'm trying to set up a dev server to work on the site.

I can load the index.php in views if i go to this url

http://102.236.250.217/app/views/nycity/

But none of the header/footers or css are working I feel like my controller "class Nycity extends MY_Controller" is not working what could be the cause of this?

This is my htaccess:

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

<Files "index.php">
 AcceptPathInfo On
</Files>  

Upvotes: 0

Views: 862

Answers (2)

Ibnu Agiels Althur
Ibnu Agiels Althur

Reputation: 69

First, you have to check your route default controller, you should find routes.php in config folder, and this what you should write in:

$route['default_controller'] = 'your_default_controller';

Depending on your description, it should be like this

$route['default_controller'] = 'app';

And in your app controller should load the "nycity" view

Upvotes: 0

cssBlaster21895
cssBlaster21895

Reputation: 3710

Read codeigniter's user guide, learn directory structure, it's MVC. Find where your index.php file is and point domain there.

The rest is magic. Good luck!

P.s. MY_Controller should be located inside application/core according to the rules.

Upvotes: 1

Related Questions