Reputation: 21
Can someone explain the syntax of a web addresses URL in layman's terms.
Upvotes: 2
Views: 2769
Reputation: 461
protocol://subdomain.domain.topLevelDomain:port/path/path.extension?query&morequery=value#fragment for the web mostly.
Or check out Simple.wikipedia article for a nice layman explanation.
Upvotes: 2
Reputation: 274522
Take a look at RFC 1738 - Uniform Resource Locators (URL) which describes:
a Uniform Resource Locator (URL), the syntax and semantics of formalized information for location and access of resources via the Internet.
Here is an extract of the BNF-like description of a http URL:
url = httpurl | ftpurl | newsurl |
nntpurl | telneturl | gopherurl |
waisurl | mailtourl | fileurl |
prosperourl | otherurl
httpurl = "http://" hostport [ "/" hpath [ "?" search ]]
hpath = hsegment *[ "/" hsegment ]
hsegment = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
search = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
Upvotes: 1
Reputation: 62573
[protocol]://[host/domain name][:port]/[path to resource]
protocol - http, https, ftp, etc
host/domain name - www.example.com, localhost, 192.34.12.1, etc
port - 80 by default for http, can be something else too
path to resource - /images/test.gif, /index.php
Upvotes: 0