简体   繁体   中英

Codeigniter Controller 404 & routing issues

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.

似乎您需要设置base_url (application / config / config.php):

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM