开发者

What is best practice use of dot slash?

I am seeing a great number of errors in our log files related t开发者_如何学编程o 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?


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"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜