如何禁用URL编码? [英] How to disable URL Encode?
本文介绍了如何禁用URL编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的网站上,我有一些带有空格的网址.这些空格由%20自动编码.
on my website i am having some urls which have spaces.those spaces are automatically encode by %20.
那我怎么禁用它呢?
我想要这个:
e.g: http://domain.com/my name/abc
相反,我得到了
http://http://domain.com/my%20name/abc
推荐答案
来自w3c规范:
URL中的空格和控制字符必须逃脱以便在HTTP,其他不允许字符.
Spaces and control characters in URLs must be escaped for transmission in HTTP, as must other disallowed characters.
因此您不能禁用"此功能.正如biscuitstack在注释中所建议的那样,请改用和下划线(_),甚至最好使用连字符(-).
So you cannot 'disable' this. As biscuitstack suggested in the comments, use and underscore (_) instead, or even better a hyphen (-).
这篇关于如何禁用URL编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文