News for hackers. Stuff that matters.

Ask HN: Why are commas not allowed in urls?

I've always been curious why certain characters (e.g. commas) haven't been allowed in the url. I've never seen one used in a specialized way at all, are they just nonexistent in usage? If so, why?
( 7 comments | 8 points | on HN )
Re:Ask HN: Why are commas not allowed in urls? by daveslash on Friday May 30, 2014 @06:55PM (#7824535)
My best guess. From RFC 3986 (link below)

For example, the semicolon (";") and equals ("=") reserved characters are often used to delimit parameters and parameter values applicable to that segment. The comma (",") reserved character is often used for similar purposes. For example, one URI producer might use a segment such as "name;v=1.1" to indicate a reference to version 1.1 of "name", whereas another might use a segment such as "name,1.1" to indicate the same.

http://www.ietf.org/rfc/rfc3986.txt

EDIT: This RFC is for URIs and your question was about URLs. URLs are generally considered a subset of URIs, but according to this SO answer, that might be open to debate. http://stackoverflow.com/questions/176264/whats-the-differen...

Re:Ask HN: Why are commas not allowed in urls? by tronium on Friday May 30, 2014 @07:20PM (#7824611)
Thanks dave, that helped explain a little. However, I still have never actually seen a comma used as a parameter in a URL, do you have an example?
Re:Ask HN: Why are commas not allowed in urls? by mcintyre1994 on Friday May 30, 2014 @07:58PM (#7824705)
The only case I can remember, and I'm not even sure why I remember is it was used as a delimiter in the Runescape forums. Just checked and it still seems to be, eg http://services.runescape.com/m=forum/forums.ws?185,186,980,...
Re:Ask HN: Why are commas not allowed in urls? by daveslash on Monday June 02, 2014 @03:21PM (#7835485)
Sorry for the late response. I don't have an example, sorry.

Commas should not be used in URLs because they are so frequently used as delimiters in other scenarios. That's not to say that it can't work (so I'm sure there are some URLs with commas), but according to that RFC we shouldn't use them. Any URL with commas in it would be in violation of that spec. But hey, this is the web, we like to break specs all the time! ;-) It's my impression that this is more for sanity reasons than technical limitations.

Re:Ask HN: Why are commas not allowed in urls? by randallma on Saturday May 31, 2014 @11:53PM (#7828110)
The Onion has their article urls in the format:

http://www.theonion.com/articles/scientific-community-baffle...

/articles/slug,id/

Re:Ask HN: Why are commas not allowed in urls? by daveslash on Monday June 02, 2014 @03:23PM (#7835507)
Wow, thanks, I don't think I'd ever noticed a URL with a comma. I don't think it's a valid* URL, but apparently it's definitely do-able.

*valid == conforming to spec.

Re:Ask HN: Why are commas not allowed in urls? by rahimnathwani on Saturday May 31, 2014 @08:08AM (#7825847)
Vignette StoryServer, a CMS from back in the day, had commas in all (or almost all) the URLs it generated.

http://en.wikipedia.org/wiki/StoryServer