14

I'm learning Web tech and teacher cannot give me a satisfactory explanation. I'd like to give a few example, please help me to point out am I right.

Microos
  • 1,728
  • 3
  • 17
  • 34
  • look at this answer http://stackoverflow.com/questions/176264/what-is-the-difference-between-a-uri-a-url-and-a-urn/1984225#1984225 – oleh.meleshko Jan 18 '16 at 07:52

3 Answers3

20

The URI standard is STD 66, which currently maps to RFC 3986.

URI vs. URL

Section 1.1.3 describes the difference between URIs and URLs (and URNs).

Components

Section 3 describes the components a URI can have.

For the URI http://www.example.org:56789/a/b/c.txt?t=win&s=chess#para5 these would be:

request-URI

The term "request-URI" is not defined or even used in STD 66 / RFC 3986.

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • Thank you unor, good basic example and well reference to https://tools.ietf.org/html/rfc3986#section-1.1.3 site. – S. Mayol Feb 21 '19 at 20:10
  • 1
    Can you please edit your answer and provide an at a glance "this what an URI looks like" and "this is what an URL" looks like? –  Jan 12 '21 at 01:31
9

The term "Request-URI" is defined by the HTTP standard (RFC 2616, §5.1.2), and refers to the URL as it is given in the actual HTTP request.

In normal HTTP requests, the URL scheme and host have already been handled by the time the request is sent (and the URL fragment does not exist at the HTTP protocol level at all), meaning the Request-URI is a path-absolute-URL string, possibly followed by ? and a URL-query string.

That is to say, this part of the complete URL:

https://example.org/path/to/file?param=42#fragment
                   ^^^^^^^^^^^^^^^^^^^^^^

Note that it includes the leading /.

Exceptions to this include:

  • For e.g. the OPTIONS HTTP method, the Request-URI may simply be *.
  • When the HTTP server is acting as a proxy, the Request-URI may be a complete absolute-URL string (still excluding the fragment).
  • Other, more elaborate/non-standard things.
Community
  • 1
  • 1
Søren Løvborg
  • 8,354
  • 2
  • 47
  • 40
-2

I know it's an old topic, but I came across it on my current research, maybe others will have related issues:

You can find the term "Request_URI" in the apache server language, I don't know if that was ment... Here it would be similiar to "Path", i.e. used to lock the access via .htaccess to a specific URL somehow like this:

URL: www.example.de/lockthissite/

.htaccess code:

SetEnvIfNoCase Request_URI ^/lockthissite/$ SECURED=yes

AuthType Basic
AuthName "restricted access"
AuthUserFile /path/to/my/.htpasswd
Require valid-user
Satisfy any
Order allow,deny
Allow from all
Deny from env=SECURED

ToTaTaRi
  • 311
  • 1
  • 8