94

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
  • 643,351
  • 109
  • 780
  • 844
jnicklas
  • 2,155
  • 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

105

It is called the origin.


More generally speaking, here are the different parts of a URL, as per 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

Note that the exact naming of each part may be different in different standards. For example, 'host' in RFC 6454 section 4. means 'hostname' in the above diagram.

d4nyll
  • 11,811
  • 6
  • 54
  • 68
  • 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
  • 1
    The RFC you linked directly contradicts your definition of `host`. It does not include the port in the host, but rather as a separate component. – Brennan Vincent Jul 18 '22 at 17:06
30
  • 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
  • 11,875
  • 18
  • 85
  • 108
Richard JP Le Guen
  • 28,364
  • 7
  • 89
  • 119
  • 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
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
  • 68,824
  • 13
  • 156
  • 205
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
  • 107,573
  • 31
  • 204
  • 267
  • 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
3

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

Chris F Carroll
  • 11,146
  • 3
  • 53
  • 61
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
  • 5,045
  • 1
  • 34
  • 44
-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
  • 43,890
  • 13
  • 88
  • 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
  • 29,059
  • 15
  • 130
  • 154
appusajeev
  • 2,129
  • 3
  • 22
  • 20
  • 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