在网址中不允许冒号? [英] Are colons allowed in URLs?

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

问题描述

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

的URI

  1. 你觉得什么冒号URI中使用?

  2. 如何让我的Apache服务器的工作与冒号语法,因为现在它扔了禁止访问!当有在URI?
  3. 的第一段冒号错误

解决方案

冒号允许在URI路径。但是,你有一个冒号写作相对URI路径时,因为像这样使用时不允许需要小心:

 < A HREF =标签:样品>

在这种情况下,标记将PTED作为URI的方案间$ P $。相反,你需要把它写这样的:

 < A HREF =./标签:样本>

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. What do you feel about the usage of colons in URIs?
  2. How do I make my Apache server work with the "colon" syntax because now it's throwing the "Access forbidden!" error when there is a colon in the first segment of the 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">

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

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

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

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