25

I notice Wikipedia allows them in their URLs, is it legit or does anyone know where it will give me problems?

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Kristopher Ives
  • 5,838
  • 7
  • 42
  • 67

3 Answers3

23

It's legit and intended to be a delimiter ; see Uniform Resource Identifier (URI): Generic Syntax

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Richard Harrison
  • 19,247
  • 4
  • 40
  • 67
12

As per http://www.ietf.org/rfc/rfc1738.txt YES, you can.

...Only alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()," [not including the quotes - ed], and reserved characters used for their reserved purposes may be used unencoded within a URL.

refer: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

Nishant
  • 54,584
  • 13
  • 112
  • 127
7

Yes. All of the sub-delims characters can be used as is in the path. Sub-delimiters include the asterisk (*) character:

sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
              / "*" / "+" / "," / ";" / "="

There are several types of URIs, but in general, a path is defined as a set of segments separated by a slash:

path-absolute = "/" [ segment-nz *( "/" segment ) ]

The segments are composed of characters (segment-nz cannot be empty):

segment       = *pchar
segment-nz    = 1*pchar

And pchar includes sub-delims:

pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"

Reference: https://www.rfc-editor.org/rfc/rfc3986#appendix-A

Community
  • 1
  • 1
Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156