Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are colons allowed in URLs?

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?
like image 511
Emanuil Rusev Avatar asked Nov 15 '09 13:11

Emanuil Rusev


People also ask

What Does a colon mean in a URL?

It's just a separator. It doesn't 'mean' or 'specify' anything. In your own example it is also used to separate the scheme from the hostname.

Is Semi Colon allowed in URL?

Not only do they exclude valid characters like semicolons and parentheses, that last one matches all kinds of invalid characters like quotation marks, braces, and non-ASCII characters.

Can a URL contain special characters?

A URL is composed of a limited set of characters belonging to the US-ASCII character set. These characters include digits (0-9), letters(A-Z, a-z), and a few special characters ( "-" , "." , "_" , "~" ). When these characters are not used in their special role inside a URL, they must be encoded.

Is comma URL safe?

Answer: While it's definitely possible to use commas in URLs, it's not a widely used practice, nor is it recommended. When it comes to most online users, anything out of the ordinary can make them wary of a Web site. And with our example above, just seeing a comma-delineated URL may cause site visitors to click away.


1 Answers

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"> 
like image 97
Gumbo Avatar answered Sep 28 '22 15:09

Gumbo