首页 > 解决方案 > 有没有理由在 URL 中使用混合斜杠?

问题描述

https:\/\/我刚开始工作的网站有大量以或开头的链接 http:\/\/- 在我问这是否是某些查找/替换程序运行异常的结果之前,任何人都可以解释是否有充分的理由使用它?

可能是一个非常菜鸟的问题,提前非常感谢!

标签: url

解决方案


According to the URL specification, the backslash is considered an unsafe character and needs to be encoded:

Octets must be encoded if they have no corresponding graphic character within the US-ASCII coded character set, if the use of the corresponding character is unsafe [...]

And:

Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are "{", "}", "|", "\", "^", "~", "[", "]", and "`".


推荐阅读