tags:

views:

100

answers:

1

I am seeing a great number of errors in our log files related to the use of the dot-slash "./" on the href attribute of the anchor tag. It only happens when the hit comes from a java client.

HTML DOCUMENT
<a href="./myPage.php">Link to a dot-slash file</a>

ACCESS LOG ENTRY
my.domain.com 123.456.789.012 - - [26/Jan/2010:14:17:15 -0500] "GET /legal/./myPage.php HTTP/1.1" 200 5295 "-" "Java/1.6.0_14"

ERROR LOG ENTRY
[Tue Jan 26 14:17:15 2010] [error] [client 123.456.789.012] request failed: erroneous characters after protocol string: GET /legal/\\" + gaJsHost + \\"google-analytics.com/ga.js HTTP/1.1

Is it a best practice to use or not use the dot-slash?

+3  A: 

As far as I know the dot-slash is only used in *nix and not "on the internet". I'd advise not using it, also because (afaik)

href="./example.php"

is pretty much the same as

href="example.php"
Niels Bom
Thanks Niels. You are correct in that the "./" in a href yields the same result as not using the "./".
Dr. DOT