2011-02-18 74 views
1

有人可以用通俗的术语解释网址的语法。URL的语法是什么

+4

[见这里](http://en.wikipedia.org/wiki/Uniform_Resource_Locator) – 2011-02-18 15:37:06

回答

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 
1

协议://subdomain.domain.topLevelDomain:端口/路径/ path.extension查询& morequery用于web大多=值#片段?。

或退房Simple.wikipedia article一个很好的外行解释。

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 | ";" | ":" | "@" | "&" | "=" ]