Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does dollar sign $ do in url?

Tags:

security

url

web

I have been reading that $ ! ; . , are 'reserved' chars in url. But I can not find what are they reserved for.

/ path delimiter   : port ? query   & glue get params   = param=val   \# link anchor   + space 

.

My specific questions:
Does anyone know what are $ ! ; . , used for?
Does : have any special meaning in request uri?

like image 333
CoR Avatar asked Nov 18 '13 14:11

CoR


People also ask

What does dollar sign mean in coding?

When used in a regular expression, the dollar sign is used to represent the end of the line or string. For example, in the following Perl code, if the user's input stored in the $input variable ends with the "example," it would print "I see example." to the screen.

How do you encode a dollar sign?

Encoding. The dollar sign "$" has Unicode code point U+0024 (inherited from ASCII via Latin-1). There are no separate encodings for one- and two-line variants.

How do I get hash character out of URL?

Replace the hash with %23 . # is a valid URI character, but it starts the hash fragment, so you need to encode it in the query string. Compare encodeURIComponent('#') .


2 Answers

RFC 2396 is obsolete.

For modern versions of the spec, see:

  • RFC3987 (in relation to IRI's); and
  • RFC3986 (in relation to URI's).

About /

Yes, that is used as a delimiter in the path part.

About :

Ye, it is used as a prefix for port, but it has other roles such as the user info separator, and a delimiter for IP styles of host specifiers.

About =

Suprisingly, the = character is not part of the general URL, URI nor IRI syntax. It has a special meaning only the the http(s) protocols. This is not intrinsic to URL/IRI/URI

About +

The role of + as a substitute for space is NOT part of the URL/URI/IRI syntax. It is merely a convenient invention of some PHP programs for pretty URL purposes.

About $ and ;

These have no special meaning in the URL/URI/IRI syntax. They can be part of the sub-delimiters production, which can be used in the user info part, future-IP part, path segment or a host part.

like image 103
Sean B. Durkin Avatar answered Oct 03 '22 05:10

Sean B. Durkin


Your question is a bit broad, but the RFC 2396 should contain all your answers.

Many URI include components consisting of or delimited by, certain special characters. These characters are called "reserved", since their usage within the URI component is limited to their reserved purpose. If the data for a URI component would conflict with the reserved purpose, then the conflicting data must be escaped before forming the URI.

 reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |                 "$" | "," 

The "reserved" syntax class above refers to those characters that are allowed within a URI, but which may not be allowed within a particular component of the generic URI syntax; they are used as delimiters of the components described in Section 3.

Characters in the "reserved" set are not reserved in all contexts. The set of characters actually reserved within any given URI component is defined by that component. In general, a character is reserved if the semantics of the URI changes if the character is replaced with its escaped US-ASCII encoding.

like image 36
Kermit Avatar answered Oct 03 '22 03:10

Kermit