Codeigniter Controller 404 & routing issues

946 Views Asked by At

so I've had experience building codeigniter applications in the past so I'm slightly familiar with the framework

however anytime prior I've worked directly from the root (http://domain.com/)

I'm currently trying to develop & deploy an application which will be hosted in subfolders (http://domain.com/foo/bar)

I have a decent grasp on routing but I'm not sure what's going on. going to http://domain.com/foo/bar loads without issue, but anytime I try to add a new route such as http://domain.com/foo/bar/myController -- I get a 404. The server is essentially trying to load http://domain.com/foo/bar/myController/index.php versus using the framework controller--

is this some kind of server configuration or setting? do I have to do something with htaccess? (all I have had to do in the past is scrub index.php out of the URL)

for the record the issue is not that the controller is broken/missing/named improperly, if I set the default controller to myController the page will load without issue.

I'm a little confused and looking for any kind of advice. thanks in advance.

1

There are 1 best solutions below

1
André Laszlo On

It seems like you need to set base_url (application/config/config.php):

$config['base_url'] = 'http://domain.com/foo/bar';