URL 中是否允许使用冒号? [英] Are colons allowed in URLs?

查看:67
本文介绍了URL 中是否允许使用冒号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为在 URI 中使用冒号是非法的".然后我看到 vimeo.com 正在使用像 http://www.vimeo.com/tag:sample.

I thought using colons in URIs was "illegal". Then I saw that vimeo.com is using URIs like http://www.vimeo.com/tag:sample.

  1. 您对 URI 中冒号的使用有何看法?
  2. 如何让我的 Apache 服务器使用冒号"语法,因为它现在抛出禁止访问!"URI 的第一段中有冒号时出错?

推荐答案

URI 路径中允许有冒号.但是在使用冒号写入相对 URI 路径时需要小心,因为这样使用时是不允许的:

Colons are allowed in the URI path. But you need to be careful when writing relative URI paths with a colon since it is not allowed when used like this:

<a href="tag:sample">

在这种情况下,tag 将被解释为 URI 的方案.相反,你需要这样写:

In this case tag would be interpreted as the URI’s scheme. Instead you need to write it like this:

<a href="./tag:sample">

这篇关于URL 中是否允许使用冒号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆