鏈接具有正斜槓之前,它應該加載到您的Web項目中的任何文件夾與主域名。
如果你有這樣的:
domain.com/index.php
domain.com/archive/index.php
兩者的index.php文件有以下幾點:
<a href="/">home</a>
<a href="/archive">archive</a>
所有在這兩個文件中的鏈接都喜歡絕對鏈接:
<a href="http://domain.com/">home</a>
<a href="http://domain.com/archive">archive</a>
有兩個問題可以產生相對鏈接:
1- Having a ./ rather than/in your links. (And that is the best guess)
2- Bots understands links and love links with "/" not with "http://domain.com/"
but you might uploaded a file with a ./ link before
and bots got it and you have it recorded.
另外,相鏈接的主文件夾它們是內部內進行處理,例如:
把下列:
<a href="./another_directory">Other Page</a>
<a href="./archive">archive</a>
內:
domain.com/archive/index.php
將LEED到:
<a href="http://domain.com/another_directory">Other Page</a>
<a href="http://domain.com/archive/archive">archive</a>