7

Will the URI of this URL, for example http://news.bbc.co.uk/sport include http:// at the front, making the URI http://news.bbc.co.uk ?

Or, is the URI just news.bbc.co.uk ?

Rob
  • 71
  • 1
  • 2
  • http://en.wikipedia.org/wiki/URI_scheme – bzlm Mar 28 '11 at 19:01
  • 1
    possible duplicate of [What is the difference between a URI and URL?](http://stackoverflow.com/questions/4428196/what-is-the-difference-between-a-uri-and-url) – bzlm Mar 28 '11 at 19:01

2 Answers2

11

A URI per RFC 3986 has the grammar:

URI         = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

So, yes, the scheme http as well as the separating : and the // prefix of the hier-part are part of the URI. news.bbc.co.uk is only the host.

Community
  • 1
  • 1
Gumbo
  • 643,351
  • 109
  • 780
  • 844
  • Cheers. that really helped a lot? If the www prefix was also included, would that also be part of the URI, or would that only be part of the URL? Thanks again – Rob Mar 28 '11 at 19:10
  • @Rob, yes, `www` is part of the host name (see the link at the end of this answer). You can't assume `www.bbc.co.uk` and `bb.co.uk` are equivalent host names in either a URI or a URL. They may be or many not. – Matthew Flaschen Mar 28 '11 at 19:19
  • 2
    @Rob: [A URL is also a URI](http://tools.ietf.org/html/rfc3986#section-1.1.3): “The term "Uniform Resource Locator" (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network "location").” – Gumbo Mar 28 '11 at 19:23
2

The URI Scheme (http, ftp, file et.c.) is part of the uri.

Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93