3

head我的文档中有以下标签:

<base href="/some/folder/">.

假设我的网站位于http://example.com. 一个链接,像这样:

<a href="foo/bar/">...</a>

页面上将解析为http://example.com/some/folder/foo/bar/.

但是,像这样的链接:

<a href="/">...</a>

当我真正希望http://example.com它指向http://example.com/some/folder/.

在这种情况下,如何创建指向应用程序基础的链接,而无需http://example.com在任何地方进行硬编码?

4

1 回答 1

4

尝试<a href="./">...</a> 代替cbroe<a href="/">...</a>. 指出的

于 2014-07-31T16:06:10.027 回答