advantage of full links is google might pick them up as references. happened to my old site and resulted in a higher google rating!Conrad11 said:Hi there,
When people are doing hyperlinks do they use relative or full paths?
Any advantage of either?
Thanks.
Craig321 said:Advantage of relative paths is you can move the script around without worrying about links.
No. A lot of people tend to (whether this is good practice or not, I have no idea) set a global variable as the document root (e.g. www.websitename.com/applicationname/) then use relative URLs within the application itself. That way all one has to do when moving the application around is redefine the global document root variable.Conrad11 said:Surely that is irrelivant, cause you would have to change the links anyways if you move it?
I do a slightly modified version of thisAl Vallario said:No. A lot of people tend to (whether this is good practice or not, I have no idea) set a global variable as the document root (e.g. www.websitename.com/applicationname/) then use relative URLs within the application itself. That way all one has to do when moving the application around is redefine the global document root variable.
Conrad11 said:Surely that is irrelivant, cause you would have to change the links anyways if you move it?
$include "includes/hello.php";
$include "http://www.blah.com/includes/hello.php";
<a href="index.php">Home</a>
<a href="http://www.site.com/index.php">Home</a>