[Solved]Problems in URL when using controller/method, please help |
[eluser]prince1001[/eluser]
Hi I'm trying to solve this problem that has kept me going now the whole day! My site works fine with codeigniter when I use URL's with only the controller. If I use controller/method I get strange results. For example: I use htpp://127.0.0.1/ci --> redirect to homepage http://127.0.0.1/ci/index.php/welcome --> this is OK In this page I have a link to the page http://127.0.0.1/ci/index.php/forgottenp...gepassword. When I click this link all my links in the page forgottenpassword/changepassword have the forgottenpassword after the index.php page! The page http://127.0.0.1/ci/index.php/welcome becomes http://127.0.0.1/ci/index.php/forgottenpassword/welcome! So I recieve page not found! If searched, changed the config file, added the? behind index.php etc... I found out that if I use anchor(), it works, but links made with <a ></a> have problems. Anybody? Please help!
[eluser]Crimp[/eluser]
It's hard to say. Your question is a little confusing. This part in the user guide about CI URLs may help: http://ellislab.com/codeigniter/user-gui.../urls.html.
[eluser]cahva[/eluser]
I think I know what you mean. You have links like this in your code: Code: <a href="welcome"> Welcome </a> Either use anchor() which adds your base_url to the links, or you can also set base tag and all your links are relative to that. Example: Code: <html>
[eluser]prince1001[/eluser]
Cahva, you are right! That was the problem. I added the base tag and it is working now. Thank you very much! |
Welcome Guest, Not a member yet? Register Sign In |