Welcome Guest, Not a member yet? Register   Sign In
A SLASH problem of relative href value

(This post was last modified: 01-31-2016, 10:03 PM by dangyuluo.)

When using a relative A link, there seems to be a little problem.
Assume there is a page whose url is http://www.site.com/user/index. And normally we can also visit it through http://www.site.com/user/index/, with a slash in the end. Though CodeIgniter could handle it elegantly, showing the correct page content, the browser wrongly regards these two pages as in two different folders.

If I'm using a relative A link in this page, like <a href='order'></a>. When people visiting the URL without slash in the end, they can be led to http://www.site.com/user/order which is the correct path, cause the browser will try to find order within the same folder of index.

But, here comes the problem, if the users visit the page with a slash in the end, and if they click the A link, they will be led to http://www.site.com/user/index/order. Now the browser will try to find order in the tub-folder of index.

I know site_url() can generate an absolute path of link. But it's neither elegant nor traffic-consuming. So does anybody come up with a solution of this problem? Thanks.

Messages In This Thread
A SLASH problem of relative href value - by dangyuluo - 01-31-2016, 07:43 PM

Theme © iAndrew 2016 - Forum software by © MyBB