CodeIgniter Forums
uri problem - 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: uri problem (/showthread.php?tid=19868)



uri problem - El Forum - 06-21-2009

[eluser]alberta[/eluser]
i have problem in uri , i am using this

Code:
<a href='projects/index/{id}' rel="lyteframe">{code}</a>

first time it goes correctly, and uri becomes

Code:
http://localhost/project/index.php/projects/index/5

when i second time clink on it then uri becomes, then it concatenates with previous one and becomes

Code:
http://localhost/project/index.php/projects/index/5/projects/index/6

can some one tell me how to get rid of this ??

Thanks


uri problem - El Forum - 06-21-2009

[eluser]n0xie[/eluser]
Auto load URI helper class and try this:
Code:
<a href='&lt;?php echo site_url(); ?&gt;projects/index/{id}' rel="lyteframe">{code}</a>



uri problem - El Forum - 06-21-2009

[eluser]TheFuzzy0ne[/eluser]
You need to prefix you're URL with a forward slash:
Code:
<a href='/projects/index/{id}' rel="lyteframe">{code}</a>

EDIT: ...Or do what n0xie suggested Big Grin


uri problem - El Forum - 06-21-2009

[eluser]mTuran[/eluser]
Firstly setup project.loc address for developing app:

http://www.elxis.org/guides/developers-guides/local-apache-and-virtual-hosts.html

Then link from root like that:

Code:
<a href='/projects/index/{id}' rel="lyteframe">{code}</a>

When you upload to your web site, you have not to change anything i will be not use any extra helper.

I think this is best way.