有人可以用外行的术语解释网址的语法。
答案 0 :(得分:1)
protocol://subdomain.domain.topLevelDomain:port / path / path.extension?query& morequery = value#片段主要用于网络。
或者查看Simple.wikipedia article以获得一个好的外行解释。
答案 1 :(得分:0)
[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
答案 2 :(得分:0)
看一下描述的RFC 1738 - Uniform Resource Locators (URL):
统一资源定位器(URL), 形式化的语法和语义 有关位置和访问的信息 通过互联网获取资源。
以下是http URL的类似BNF描述的摘录:
url = httpurl | ftpurl | newsurl |
nntpurl | telneturl | gopherurl |
waisurl | mailtourl | fileurl |
prosperourl | otherurl
httpurl = "http://" hostport [ "/" hpath [ "?" search ]]
hpath = hsegment *[ "/" hsegment ]
hsegment = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
search = *[ uchar | ";" | ":" | "@" | "&" | "=" ]