93

If I have a URL like:

http://www.example.com:9090/test.html

Then I know that www.example.com is the host name, but what do you call http://www.example.com:9090? Is there some kind of established name for that?

Gumbo
  • 620,600
  • 104
  • 758
  • 828
jnicklas
  • 2,125
  • 2
  • 16
  • 14
  • 2
    I like the [picture in this answer](https://english.stackexchange.com/a/42845/5312) visualizing the different parts. – Czechnology Aug 19 '17 at 21:30

8 Answers8

101

It is called the origin.


More generally speaking, here are the different parts of a URL, as per window.location. (So at least according to how Javascript calls it)

protocol://username:password@hostname:port/pathname?search#hash
-----------------------------href------------------------------
                             -----host----
-----------      origin      -------------
  • protocol - protocol scheme of the URL, including the final ':'
  • hostname - domain name
  • port - port number
  • pathname - /pathname
  • search - ?parameters
  • hash - #fragment_identifier
  • username - username specified before the domain name
  • password - password specified before the domain name
  • href - the entire URL
  • origin - protocol://hostname:port
  • host - hostname:port

Formal definition is in RFC 6454 section 4.

Community
  • 1
  • 1
d4nyll
  • 10,729
  • 6
  • 49
  • 65
  • 2
    Origin seems very specific to browser context. Is this term used wider? Are there more references? – Dima Tisnek Oct 06 '16 at 08:27
  • A URI is just a string, from reading all these answers, I get the feeling that different use cases will have different names. I got the names for this answer from `window.location`, so those are the names for the 'browser context'. See the other answers for other uses. – d4nyll Oct 10 '16 at 14:59
  • Thanks for the bounty kind stranger :p – d4nyll Oct 12 '16 at 16:50
  • 1
    what do you call everything *after* the origin? – Jonah Oct 12 '16 at 19:58
  • Not sure there's a name for it, but this should be a different question anyways :p – d4nyll Oct 13 '16 at 08:06
  • @Jonah good one, do ask a question, I guess `path, query and fragment` is explicit and correct, albeit not concise. – Dima Tisnek Oct 13 '16 at 08:42
  • So no name for the whole *URL* minus the 'test.html'? Ironic really, since this would be a really handy term! – CodeCabbie Sep 22 '17 at 08:47
  • @CodeCabbie That's called the *origin* – d4nyll Sep 23 '17 at 10:08
  • I check your source and RFC 6454 refers particularly to `origin`. What is the standard or RFC for the whole URL? Is therey any? – Aónio Feb 15 '19 at 10:28
29

I don't know the name for when it has the scheme, but the hostname with the port is collectively known as the Authority. A nice explanation here.

keyboardP
  • 67,723
  • 13
  • 149
  • 201
29
  • http:// - Protocol
  • www - Server-Name (subdomain)
  • example - Second Level Domain (SLD)
  • com - Top Level Domain (TLD)
  • 9090 - Port number
  • /test.html - Path

Save the protocol, you can refer to 'www.example.com' as either the hostname or - more specifically - the 'fully qualified domain name'.

Toss in the '9090' and personally I'd be comfortable calling it the host, as that's usually what you'd get as the 'host' header in an HTTP request; something like 'host: www.example.com:9090'. In PHP it would be stored in the $_SERVER variable under 'HTTP_HOST' or 'SERVER_NAME'. In JavaScript it would be available as the document.location.host.

I don't know, what you could call it once you toss in 'http://' :(

peterh
  • 1
  • 15
  • 76
  • 99
Richard JP Le Guen
  • 27,705
  • 7
  • 87
  • 116
  • Thanks Richard, this was helpful. For a more complete list see http://www.mattcutts.com/blog/seo-glossary-url-definitions/ – Ryan Jan 13 '12 at 17:56
14

RFC 3986 details the syntax components. The part you refer to would be the scheme (http) and authority (www.example.com:9090).

Community
  • 1
  • 1
McDowell
  • 105,511
  • 29
  • 196
  • 262
  • how do we merge this terminology with the one given in `windows.location`? I'm confused! Shall we. for example, call it `protocol` or `scheme`? – Aónio Feb 15 '19 at 10:34
2

FWIW, the .Net framework Uri class goes for "GetLeftPart()". It's irritating not having a proper name for "scheme + authority"

Chris F Carroll
  • 9,469
  • 3
  • 49
  • 53
0

I don't think so. If there was, I would expect the DOM to reflect this in the window.location class: https://developer.mozilla.org/En/DOM/Window.location

Teun D
  • 4,954
  • 1
  • 33
  • 43
-2

You can read about every part of URL on Wikipedia. You'll find there that http is a protocol name, :9090 determines that the connection should be establishment on port #9090 etc.

Crozin
  • 42,946
  • 13
  • 87
  • 135
-3

It means that the HTTP server hosting example.com is using the port 9090 for processing HTTP requests, it is a directive to the browser that it should connect to that server on port 9090 instead of 80 which it normally does if the port is not specified

AmerllicA
  • 23,670
  • 12
  • 111
  • 138
appusajeev
  • 1,889
  • 3
  • 18
  • 19
  • 2
    That's not what @jnicklas asked, I'm sure he knows what port is and how to change it. He wants to know how to name that exact part of URI (to store it in database under that name probably) – llamerr Nov 16 '15 at 21:06