I have the following tag inside the head
of my document:
<base href="/some/folder/">
.
Let's say my website is at http://example.com
. A link, like this:
<a href="foo/bar/">...</a>
on the page will resolve to http://example.com/some/folder/foo/bar/
.
However, a link like this:
<a href="/">...</a>
will resolve to http://example.com
when I actually want it to point to http://example.com/some/folder/
.
In this situation, how can I create a link to the base of my application without hardcoding http://example.com
anywhere?
Try <a href="./">...</a>
instead of <a href="/">...</a>.
As pointed out by cbroe