什么是最好的实践使用点斜杠? [英] What is best practice use of dot slash?
问题描述
我在日志文件中发现了大量与锚标记的href属性上使用点斜线./相关的错误。它只发生在来自java客户端的命中时。
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\">链接到点斜杠文件< / a>
HTML DOCUMENT
<a href="./myPage.php">Link to a dot-slash file</a>
访问日志条目
my.domain.com 123.456.789.012 - - [26 / Jan / 2010:14:17:15 -0500]GET /legal/./myPage.php HTTP / 1.1200 5295 - Java / 1.6.0_14
错误日志输入
[Tue Jan 26 14:17:15 2010] [error] [client 123.456.789.012] request failed:协议字符串后的错误字符:GET / legal / \\+ gaJsHost + \\google-analytics.com/ga .js HTTP / 1.1
使用或不使用点斜线的最佳做法是什么?
Is it a best practice to use or not use the dot-slash?
推荐答案
据我所知,点斜线只用于* nix而不是在互联网上。
我建议不要使用它,也因为(afaik)
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"
这篇关于什么是最好的实践使用点斜杠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!