2011-02-18 121 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 | ";" | ":" | "@" | "&" | "=" ]