如何停止 url 中显示%20 的空格?
如果我们查看特定页面,就会出现问题:
http://www.completeofficechairs.co.uk/RH%20Extend%20220
应该有空格的地方,却显示 %20。
因此,它的意思不是http://www.completeofficechairs.co.uk/RH%20Extend%20220
:
http://www.completeofficechairs.co.uk/RH Extend 220
我该如何阻止这个?
我使用的是 apace Web 服务器,那么它可能是一个 htaccess mod 吗?
If we look at a specific page the problem is occuring:
http://www.completeofficechairs.co.uk/RH%20Extend%20220
Where there are meant to be spaces, its showing %20.
So instead of http://www.completeofficechairs.co.uk/RH%20Extend%20220
its meant to be:
http://www.completeofficechairs.co.uk/RH Extend 220
How do I stop this?
Im on an apace web server, so could it be a htaccess mod?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
URL 中不允许有空格。它们必须被转义(它们的转义字符是 %20)。我认为没有任何方法可以完成您想要做的事情。
Spaces are not allowed in URLs. They have to be escaped (their escape character is %20). I don't think there is any way to accomplish what you are trying to do.
请勿使用空格或将其替换为下划线
_
或破折号-
。您的网址会看起来更好并且易于阅读:Do not use spaces or replace them with underscores
_
or dashes-
. Your url will look better and be human-readable:嗯,您可以通过用 %09 替换 %20 来避免奇怪的 %20,但它会提供制表符空间而不是空格,但这不是一个完美的解决方案,但可以替换 %20。希望有帮助
Umm you can avoid that wierd %20 by replcing %20 with %09 but it will give tab space instead of space but which is not a perfect solution but can replace %20.Hope that helps