![]() |
Working with URI, getting a wrong view.. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Working with URI, getting a wrong view.. (/showthread.php?tid=33507) |
Working with URI, getting a wrong view.. - El Forum - 08-29-2010 [eluser]pstp[/eluser] As the tittle, I work with uri, and the browser said that page not found. This is my controller, lab.php: Code: function index() I have made a view named profile_view.php, also the profile_model. The browser shows Page not found for the url: http://localhost/kokko/lab/1 (1 here is the 2nd segment). What happened here guys?? Working with URI, getting a wrong view.. - El Forum - 08-29-2010 [eluser]WanWizard[/eluser] If you get "page not found", your controller can not be located. I assume CI is installed in the subdirectory 'kokko' of your webservers document root? Are your rewrite rules setup properly? Any routing rules that might interfere? Working with URI, getting a wrong view.. - El Forum - 08-29-2010 [eluser]pstp[/eluser] No Wan, my CI is installed in Kokko, so Kokko's past name is CI.. Is URI routing can't be after the class? localhost/kokko/lab/1-> lab is a classname.. What should I do best? Working with URI, getting a wrong view.. - El Forum - 08-29-2010 [eluser]WanWizard[/eluser] That's what I said. Are you getting a 404 not found error from your webserver? If so, then your rewritting is probably at fault. If your getting a "page not found" error from CodeIgniter, it can't find a controller to load. This could also be because a CI url should have /controller/method/parameters. With your URL, it looks for a method called '1', with obviously doesn't exist. Either add the method to your URL, or use the _remap() method. Working with URI, getting a wrong view.. - El Forum - 08-29-2010 [eluser]pstp[/eluser] Sorry for my technical understanding.. So, how about remap() function? I confused with remap. On example I have, the remap called after index() function, then no other function/method after the remap() function. Or is it because a class that has remap() can not have another function? For example, in my case I have localhost/kokko/lab/1, if I use remap(), means the segmen after lab can only be the id? and because of that, we can't have other method after lab? |