Issue with URL's - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Issue with URL's (/showthread.php?tid=8966) |
Issue with URL's - El Forum - 06-06-2008 [eluser]evolve08[/eluser] Hello all, new user of CI, but long time PHP programmer and web developer. I'll jump right into it. I seem to be having some issues with links. The default action is index, however if the URL isn't set to <controller>/index URL's become messed up and I'm not really sure why (they point to the default route). So, <controller>/ and <controller>/index are not acting the same way, and I think they should be. I know I can avoid the problem by using the anchor helper, however I'm converting a pre-existing script with a lot of links and would rather not change them all within the view. Hope I am explaining this correctly. Issue with URL's - El Forum - 06-06-2008 [eluser]evolve08[/eluser] Let me try to explain this a little clearer. Say I have a URL http://127.0.0.1/fence/components Everything works fine with links like: Code: <a href="./components/view/<?=$row->id?>">view</a> However say I have the URL: http://127.0.0.1/fence/components/index Then the links which worked fine before point to something similar to... http://127.0.0.1/fence/components/components/edit/12 Which is correct technically, but I need a way to prevent or stop this, I'm hoping its simply a configuration option somewhere. Thanks in advance. Issue with URL's - El Forum - 06-06-2008 [eluser]Rick Jolly[/eluser] Three options: Code: // 1. using the "base" tag in the "head" you can use relative urls: |