html - Why are visitors to my site following absolute links as if they're relative? -
every page on website has navbar absolute links, pages /archive
, /atom.xml
. these present on pages /post/post-title
.
in access logs, i'm seeing heaps of requests paths /post/post-title/archive
, /post/post-title/atom.xml
.
assuming haven't stuffed link somewhere (i.e., missed slash), there else might doing wrong that's causing clients follow absolute links if they're relative? or weird bots being weird?
links have forward slash before should load @ folder in web project main domain name.
if have this:
domain.com/index.php domain.com/archive/index.php
and both index.php files have following:
<a href="/">home</a> <a href="/archive">archive</a>
all links in both files absolute links like:
<a href="http://domain.com/">home</a> <a href="http://domain.com/archive">archive</a>
having relative links produced 2 issues:
1- having ./ rather / in links. (and best guess) 2- bots understands links , love links "/" not "http://domain.com/" might uploaded file ./ link before , bots got , have recorded.
moreover, relative links processed inside main folder inside, example:
putting following:
<a href="./another_directory">other page</a> <a href="./archive">archive</a>
inside:
domain.com/archive/index.php
will leed to:
<a href="http://domain.com/another_directory">other page</a> <a href="http://domain.com/archive/archive">archive</a>
Comments
Post a Comment