Welcome Guest, Not a member yet? Register   Sign In
Newbie routing problem
#2

[eluser]mddd[/eluser]
How are you coding your link exactly? If your link is
Code:
<a href="home">Home</a>
then it is logical. From the page /index.php, the browser will try to load /home. But from /some/page, it will try to load /some/page/home. Remember, the browser doesn't know you use CodeIgniter. It looks at the urls like normal paths!

The right thing to do is use CI's site_url function:
Code:
<a href="&lt;?=site_url('home')?&gt;">Home</a>
This will make the link relative to the root of the CI system. That way it always works, no matter where the browser thinks you are in the folder structure.


Messages In This Thread
Newbie routing problem - by El Forum - 06-14-2010, 05:31 AM
Newbie routing problem - by El Forum - 06-14-2010, 08:54 AM
Newbie routing problem - by El Forum - 06-14-2010, 08:55 AM
Newbie routing problem - by El Forum - 06-14-2010, 08:56 AM
Newbie routing problem - by El Forum - 06-14-2010, 09:00 AM
Newbie routing problem - by El Forum - 06-14-2010, 09:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB