user1765862 user1765862 - 12 days ago 5
PHP Question

default routing in codeigniter

I'm exploring codeigniter. On app startup default controller is changed to load my controller.

Controller properly loads the view and that's fine, so I'm guessing routing works as expected, but when I use (manually type on address bar other method on same controller) same url pattern /controller/method I'm getting 404 error, either view exist.

Do have to change some default routing behavior or something else is problem?

Thanks

Answer

I dont know if you already removed index.php from your url pattern, assuming that's the case you should type inside browser address field index.php/controller/method. (if you manually type url as you describe)

If you on the other hand do not want to use index.php on every link you can consider to remove that, more info here.