Jump to content

URL: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
mNo edit summary
References: updating rfcs
 
(30 intermediate revisions by 13 users not shown)
Line 5: Line 5:
{{Infobox technology standard
{{Infobox technology standard
| title = URL
| title = URL
| long_name = Uniform Resource Locator
| long_name = Uniform resource locator
| native_name =
| native_name =
| native_name_lang =
| native_name_lang =
Line 19: Line 19:
| committee = [[Web Hypertext Application Technology Working Group]] (WHATWG)
| committee = [[Web Hypertext Application Technology Working Group]] (WHATWG)
| base_standards = {{Plainlist|
| base_standards = {{Plainlist|
* {{IETF RFC|1738}}. – Uniform Resource Locators (URL).
* {{IETF RFC|3986}}. – Uniform Resource Identifier (URI): Generic Syntax.
* {{IETF RFC|3986}}. – Uniform Resource Identifier (URI): Generic Syntax.
* {{IETF RFC|4248}}. – The telnet URI Scheme.
* {{IETF RFC|4248}}. – The telnet URI Scheme.
* {{IETF RFC|4266}}. – The gopher URI Scheme.
* {{IETF RFC|4266}}. – The gopher URI Scheme.
* {{IETF RFC|6068}}. – The ‘mailto’ URI Scheme.
* {{IETF RFC|6068}}. – The 'mailto' URI Scheme.
* {{IETF RFC|6196}}. – Moving mailserver: URI Scheme to Historic.
* {{IETF RFC|6196}}. – Moving mailserver: URI Scheme to Historic.
* {{IETF RFC|6270}}. – The ‘tn3270’ URI Scheme.
* {{IETF RFC|6270}}. – The 'tn3270' URI Scheme.
}}
}}
| related_standards =[[Uniform Resource Identifier|URI]], [[Uniform Resource Name|URN]]
| related_standards =[[Uniform Resource Identifier|URI]], [[Uniform Resource Name|URN]]
Line 32: Line 33:
| website = {{URL|https://url.spec.whatwg.org}}
| website = {{URL|https://url.spec.whatwg.org}}
|first_published = {{Start date and age|1994}}|authors=[[Tim Berners-Lee]]|series=Request for Comments (RFC)|editors=[[Anne van Kesteren]]}}
|first_published = {{Start date and age|1994}}|authors=[[Tim Berners-Lee]]|series=Request for Comments (RFC)|editors=[[Anne van Kesteren]]}}
A '''Uniform Resource Locator''' ('''URL'''), colloquially termed as a '''web address''',{{sfnp|W3C|2009}} is a reference to a [[web resource]] that specifies its location on a [[computer network]] and a mechanism for retrieving it. A URL is a specific type of [[Uniform Resource Identifier]] (URI),<ref>{{Cite web |url=https://zzz.buzz/2017/09/19/forward-and-backslashes-in-urls/ |title=Forward and Backslashes in URLs |website=zzz.buzz |access-date=19 September 2018}}</ref>{{sfnp|RFC 3986|2005}} although many people use the two terms interchangeably.{{sfnp|Joint W3C/IETF URI Planning Interest Group|2002}}{{efn|A URL implies the means to access an indicated resource and is denoted by a protocol or an access mechanism, which is not true of every URI.{{sfnp|RFC 2396|1998}}{{sfnp|Joint W3C/IETF URI Planning Interest Group|2002}} Thus <code><nowiki>http:</nowiki>//www.example.com</code> is a URL, while <code>www.example.com</code> is not.<ref>{{Cite web |url=https://danielmiessler.com/study/url-uri/#gs.Hs64zOs |title=The Difference Between URLs and URIs |author-last=Miessler |author-first=Daniel}}</ref>}} URLs occur most commonly to reference [[web page]]s ([[Hypertext Transfer Protocol|HTTP]]) but are also used for file transfer ([[File Transfer Protocol|FTP]]), email ([[mailto]]), database access ([[Java Database Connectivity|JDBC]]), and many other applications.
A '''uniform resource locator''' ('''URL'''), colloquially known as an '''address''' on the [[World Wide Web|Web]],{{sfnp|W3C|2009}} is a reference to a [[web resource|resource]] that specifies its location on a [[computer network]] and a mechanism for retrieving it. A URL is a specific type of [[Uniform Resource Identifier]] (URI),<ref>{{Cite web |url=https://zzz.buzz/2017/09/19/forward-and-backslashes-in-urls/ |title=Forward and Backslashes in URLs |website=zzz.buzz |access-date=19 September 2018 |archive-date=2018-09-04 |archive-url=https://web.archive.org/web/20180904050005/https://zzz.buzz/2017/09/19/forward-and-backslashes-in-urls/ |url-status=live }}</ref>{{sfnp|RFC 3986|2005}} although many people use the two terms interchangeably.{{sfnp|Joint W3C/IETF URI Planning Interest Group|2002}}{{efn|A URL implies the means to access an indicated resource and is denoted by a protocol or an access mechanism, which is not true of every URI.{{sfnp|RFC 2396|1998}}{{sfnp|Joint W3C/IETF URI Planning Interest Group|2002}} Thus <code><nowiki>http:</nowiki>//www.example.com</code> is a URL, while <code>www.example.com</code> is not.<ref>{{Cite web |url=https://danielmiessler.com/study/url-uri/#gs.Hs64zOs |title=The Difference Between URLs and URIs |author-last=Miessler |author-first=Daniel |access-date=2017-03-16 |archive-date=2017-03-17 |archive-url=https://web.archive.org/web/20170317054341/https://danielmiessler.com/study/url-uri/#gs.Hs64zOs |url-status=live }}</ref>}} URLs occur most commonly to reference [[web page]]s ([[Hypertext Transfer Protocol|HTTP]]/[[HTTPS]]) but are also used for file transfer ([[File Transfer Protocol|FTP]]), email ([[mailto]]), database access ([[Java Database Connectivity|JDBC]]), and many other applications.


Most [[web browser]]s display the URL of a web page above the page in an [[address bar]]. A typical URL could have the form <code><nowiki>http:</nowiki>//www.example.com/index.html</code>, which indicates a protocol (<code>http</code>), a [[hostname]] (<code>www.example.com</code>), and a file name (<code>index.html</code>).
Most [[web browser]]s display the URL of a web page above the page in an [[address bar]]. A typical URL could have the form <code><nowiki>http:</nowiki>//www.example.com/index.html</code>, which indicates a protocol (<code>http</code>), a [[hostname]] (<code>www.example.com</code>), and a file name (<code>index.html</code>).
Line 43: Line 44:
Berners-Lee later expressed regret at the use of dots to separate the parts of the [[domain name]] within [[URI]]s, wishing he had used slashes throughout,{{sfnp|Berners-Lee|2015}} and also said that, given the colon following the first component of a URI, the two slashes before the domain name were unnecessary.{{sfnp|BBC News|2009}}
Berners-Lee later expressed regret at the use of dots to separate the parts of the [[domain name]] within [[URI]]s, wishing he had used slashes throughout,{{sfnp|Berners-Lee|2015}} and also said that, given the colon following the first component of a URI, the two slashes before the domain name were unnecessary.{{sfnp|BBC News|2009}}


Early [[WorldWideWeb]] collaborators including Berners-Lee originally proposed the use of UDIs: Universal Document Identifiers.<!-- cite: Tim Berners-Lee, Jean-François Groff, Robert Cailliau. "Universal Document Identifiers on the Network". CERN. <file://info.cern.ch./pub/www/doc/udi1.ps> -->
An early (1993) draft of the HTML Specification<ref>{{cite techreport |title=Hypertext Markup Language (draft RFCxxx) |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Daniel "Dan" |author-last2=Connolly |author-link2=Daniel Connolly |date=March 1993 |page=28 |url=https://www.ucc.ie/archive/curia/dtds/html-spec.ps}}</ref> referred to "Universal" Resource Locators. This was dropped some time between June 1994 ({{IETF RFC|1630|link=no}}) and October 1994 (draft-ietf-uri-url-08.txt).<ref>{{cite techreport |title=Uniform Resource Locators (URL) |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Larry |author-last2=Masinter |author-link2=Larry Masinter |author-first3=Mark Perry |author-last3=McCahill |author-link3=Mark Perry McCahill |date=October 1994 <!--|url=http://ds.internic.net/internet-drafts/draft-ietf-uri-url-08.txt-->}} (This Internet-Draft was published as a Proposed Standard RFC, {{harvp|RFC 1738|1994}}) Cited in {{cite techreport |title=Constituent Component Interface++ |author-first1=C. S. |author-last1=Ang |author-first2=D. C. |author-last2=Martin |publisher=UCSF Library and Center for Knowledge Management |date=January 1995 |url=https://listserv.heanet.ie/cgi-bin/wa?A2=ind9501&L=HTML-WG&P=R23201&X=C6F9505B05BC9A3B67}}</ref>
An early (1993) draft of the HTML Specification<ref>{{cite tech report |title=Hypertext Markup Language (draft RFCxxx) |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Daniel "Dan" |author-last2=Connolly |author-link2=Daniel Connolly |date=March 1993 |page=28 |url=https://www.ucc.ie/archive/curia/dtds/html-spec.ps |access-date=2017-10-23 |archive-date=2017-10-23 |archive-url=https://web.archive.org/web/20171023232709/https://www.ucc.ie/archive/curia/dtds/html-spec.ps |url-status=live }}</ref> referred to "Universal" Resource Locators. This was dropped some time between June 1994 ({{IETF RFC|1630|link=no}}) and October 1994 (draft-ietf-uri-url-08.txt).<ref>{{cite tech report |title=Uniform Resource Locators (URL) |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Larry |author-last2=Masinter |author-link2=Larry Masinter |author-first3=Mark Perry |author-last3=McCahill |author-link3=Mark Perry McCahill |date=October 1994 <!--|url=http://ds.internic.net/internet-drafts/draft-ietf-uri-url-08.txt-->}} (This Internet-Draft was published as a Proposed Standard RFC, {{harvp|RFC 1738|1994}}) Cited in {{cite tech report |title=Constituent Component Interface++ |author-first1=C. S. |author-last1=Ang |author-first2=D. C. |author-last2=Martin |publisher=UCSF Library and Center for Knowledge Management |date=January 1995 |url=https://listserv.heanet.ie/cgi-bin/wa?A2=ind9501&L=HTML-WG&P=R23201&X=C6F9505B05BC9A3B67 |access-date=2017-10-23 |archive-date=2017-10-23 |archive-url=https://web.archive.org/web/20171023231159/https://listserv.heanet.ie/cgi-bin/wa?A2=ind9501&L=HTML-WG&P=R23201&X=C6F9505B05BC9A3B67 |url-status=live }}</ref> In his book ''[[Weaving the Web]]'', Berners-Lee emphasizes his preference for the original inclusion of "universal" in the expansion rather than the word "uniform", to which it was later changed, and he gives a brief account of the contention that led to the change.


==<span class="anchor" id="syntax"></span>Syntax==
==<span class="anchor" id="syntax"></span>Syntax==
Line 62: Line 64:
=={{anchor|prurl}}Protocol-relative URLs==
=={{anchor|prurl}}Protocol-relative URLs==
<!--section is linked from other pages-->
<!--section is linked from other pages-->
Protocol-relative links (PRL), also known as protocol-relative URLs (PRURL), are URLs that have no protocol specified. For example, <code>//example.com</code> will use the protocol of the current page, typically HTTP or HTTPS.<ref>{{cite book |url=https://books.google.com/books?id=6u2sBAAAQBAJ&pg=PA193 |title=Secure Development for Mobile Apps: How to Design and Code Secure Mobile Applications with PHP and JavaScript |publisher=[[CRC Press]] |author-first=J. D. |author-last=Glaser |date=2013 |page=193 |access-date=12 October 2015 |isbn=978-1-48220903-7}}</ref><ref>{{cite book |url=https://books.google.com/books?id=DW0uyBZzEDwC&pg=PT124 |title=HTML, XHTML, and CSS Bible |publisher=[[John Wiley & Sons]] |author-first=Steven M. |author-last=Schafer |date=2011 |page=124 |access-date=12 October 2015 |isbn=978-1-11808130-3}}</ref>
Protocol-relative links (PRL), also known as protocol-relative URLs (PRURL), are URLs that have no protocol specified. For example, <code>//example.com</code> will use the protocol of the current page, typically HTTP or HTTPS.<ref>{{cite book |author-last=Glaser |author-first=J. D. |url={{GBurl|id=6u2sBAAAQBAJ|p=193}} |title=Secure Development for Mobile Apps: How to Design and Code Secure Mobile Applications with PHP and JavaScript |date=March 10, 2014 |publisher=[[CRC Press]] |isbn=978-1-48220903-7 |edition=1st |page=193 |language=en-US |access-date=12 October 2015}}</ref><ref>{{cite book |author-last=Schafer |author-first=Steven M. |url={{GBurl|id=DW0uyBZzEDwC|pg=PT124}} |title=HTML, XHTML, and CSS Bible |date=2011 |publisher=[[John Wiley & Sons]]|isbn=978-1-11808130-3 |edition=1st |page=124 |language=en-US |access-date=12 October 2015}}</ref>


==See also==
==See also==
Line 70: Line 72:
* [[Persistent uniform resource locator|PURL]] – Persistent URL
* [[Persistent uniform resource locator|PURL]] – Persistent URL
* [[CURIE]] (Compact URI)
* [[CURIE]] (Compact URI)
* [[Fragment identifier]]
* [[URI fragment]]
* [[Internet Resource Locator]] (IRL)
* [[Internet resource locator]] (IRL)
* [[Internationalized resource identifier]] (IRI)
* [[Internationalized Resource Identifier]] (IRI)
* [[Semantic URL]]
* [[Clean URL]]
* [[Clean URL]]
* [[Typosquatting]]
* [[Typosquatting]]
* [[Uniform Resource Identifier]]
* [[Uniform Resource Identifier]]
* [[URL normalization]]
* [[URI normalization]]
* [[Slash (punctuation)#Networking|Use of slashes in networking]]
* [[Slash (punctuation)#Networking|Use of slashes in networking]]
{{div col end}}
{{div col end}}
Line 90: Line 91:
==References==
==References==
{{refbegin|30em}}
{{refbegin|30em}}
* {{cite web |url=http://news.bbc.co.uk/1/hi/technology/8306631.stm |title=Berners-Lee "sorry" for slashes |publisher=[[BBC News]] |date=14 October 2009 |access-date=14 February 2010 |ref={{SfnRef|BBC News|2009}}}}
* {{cite web |url=http://news.bbc.co.uk/1/hi/technology/8306631.stm |title=Berners-Lee "sorry" for slashes |publisher=[[BBC News]] |date=14 October 2009 |access-date=14 February 2010 |ref={{SfnRef|BBC News|2009}} |archive-date=2020-06-05 |archive-url=https://web.archive.org/web/20200605102245/http://news.bbc.co.uk/2/hi/technology/8306631.stm |url-status=live }}
* {{cite web |url=http://www.w3.org/Conferences/IETF92/WWX_BOF_mins.html |title=Living Documents BoF Minutes |publisher=[[World Wide Web Consortium]] |date=18 March 1992 |access-date=26 December 2011 |ref={{SfnRef|IETF|1992}}}}
* {{cite web |url=http://www.w3.org/Conferences/IETF92/WWX_BOF_mins.html |title=Living Documents BoF Minutes |publisher=[[World Wide Web Consortium]] |date=18 March 1992 |access-date=26 December 2011 |ref={{SfnRef|IETF|1992}} |archive-date=2012-11-22 |archive-url=https://web.archive.org/web/20121122075812/http://www.w3.org/Conferences/IETF92/WWX_BOF_mins.html |url-status=live }}
* {{cite web |url=http://www.w3.org/Addressing/URL/url-spec.txt |title=Uniform Resource Locators (URL): A Syntax for the Expression of Access Information of Objects on the Network |first=Tim |last=Berners-Lee |author-link=Tim Berners-Lee |date=21 March 1994 |publisher=[[World Wide Web Consortium]] |access-date=13 September 2015 |ref={{SfnRef|W3C|1994}}}}
* {{cite web |url=http://www.w3.org/Addressing/URL/url-spec.txt |title=Uniform Resource Locators (URL): A Syntax for the Expression of Access Information of Objects on the Network |first=Tim |last=Berners-Lee |author-link=Tim Berners-Lee |date=21 March 1994 |publisher=[[World Wide Web Consortium]] |access-date=13 September 2015 |ref={{SfnRef|W3C|1994}} |archive-date=2015-09-09 |archive-url=https://web.archive.org/web/20150909152849/http://www.w3.org/Addressing/URL/url-spec.txt |url-status=live }}
* {{cite IETF |rfc=1738 |title=Uniform Resource Locators (URL) |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Larry |author-last2=Masinter |author-link2=Larry Masinter |author-first3=Mark Perry |author-last3=McCahill |author-link3=Mark Perry McCahill |date=December 1994 |access-date=31 August 2015 |ref={{SfnRef|RFC 1738|1994}}}}
* {{cite IETF |rfc=1738 |title=Uniform Resource Locators (URL) |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Larry |author-last2=Masinter |author-link2=Larry Masinter |author-first3=Mark Perry |author-last3=McCahill |author-link3=Mark Perry McCahill |date=December 1994 |access-date=31 August 2015 |ref={{SfnRef|RFC 1738|1994}}}}
* {{cite web |url=http://www.w3.org/People/Berners-Lee/FAQ.html#etc |author-first=Tim |author-last=Berners-Lee |author-link=Tim Berners-Lee |work=Frequently asked questions |title=Why the //, #, etc? |orig-year=2000 |date=2015 |publisher=[[World Wide Web Consortium]] |access-date=3 February 2010}}
* {{cite web |url=http://www.w3.org/People/Berners-Lee/FAQ.html#etc |author-first=Tim |author-last=Berners-Lee |author-link=Tim Berners-Lee |work=Frequently asked questions |title=Why the //, #, etc? |orig-year=2000 |date=2015 |publisher=[[World Wide Web Consortium]] |access-date=3 February 2010 |archive-date=2020-05-14 |archive-url=https://web.archive.org/web/20200514191316/https://www.w3.org/People/Berners-Lee/FAQ.html#etc |url-status=live }}
* {{cite web |url=http://www.w3.org/html/wg/href/draft#url |title=Web addresses in HTML 5 |editor-first1=Daniel "Dan" |editor-last1=Connolly |editor-link1=Daniel Connolly (computer scientist) |editor-first2=C. Michael |editor-last2=Sperberg-McQueen |editor-link2=C. Michael Sperberg-McQueen |date=21 May 2009 |publisher=[[World Wide Web Consortium]] |access-date=13 September 2015 |ref={{SfnRef|W3C|2009}}}}
* {{cite web |url=http://www.w3.org/html/wg/href/draft#url |title=Web addresses in HTML 5 |editor-first1=Daniel "Dan" |editor-last1=Connolly |editor-link1=Daniel Connolly (computer scientist) |editor-first2=C. Michael |editor-last2=Sperberg-McQueen |editor-link2=C. Michael Sperberg-McQueen |date=21 May 2009 |publisher=[[World Wide Web Consortium]] |access-date=13 September 2015 |ref={{SfnRef|W3C|2009}} |archive-date=2015-07-10 |archive-url=https://web.archive.org/web/20150710151425/http://www.w3.org/html/wg/href/draft#url |url-status=live }}
* {{cite web |url=http://www.atm.tut.fi/list-archive/ietf-announce/msg13572.html |archive-url=https://web.archive.org/web/20041208124351/http://www.atm.tut.fi/list-archive/ietf-announce/msg13572.html |archive-date=8 December 2004 |title=Completion of IANA Selection of IDNA Prefix |author=IANA |work=IETF-Announce mailing list |date=14 February 2003 |access-date=3 September 2015 |author-link=Internet Assigned Numbers Authority}}
* {{cite web |url=http://www.atm.tut.fi/list-archive/ietf-announce/msg13572.html |archive-url=https://web.archive.org/web/20041208124351/http://www.atm.tut.fi/list-archive/ietf-announce/msg13572.html |archive-date=8 December 2004 |title=Completion of IANA Selection of IDNA Prefix |author=IANA |work=IETF-Announce mailing list |date=14 February 2003 |access-date=3 September 2015 |author-link=Internet Assigned Numbers Authority }}
* {{cite journal |url=https://tools.ietf.org/html/rfc1866#section-8.2.1 |title=Hypertext Markup Language – 2.0 |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Daniel "Dan" |author-last2=Connolly |author-link2=Daniel Connolly (computer scientist) |publisher=[[Internet Engineering Task Force]] |date=November 1995 |doi=10.17487/RFC1866 |s2cid=6628570 |access-date=13 September 2015 |ref={{SfnRef|RFC 1866|1995}}}}
* {{cite IETF |rfc=1866|section=8.2.1 |title=Hypertext Markup Language – 2.0 |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Daniel "Dan" |author-last2=Connolly |author-link2=Daniel Connolly (computer scientist) |publisher=[[Internet Engineering Task Force]] |date=November 1995 |s2cid=6628570 |access-date=13 September 2015 |ref={{SfnRef|RFC 1866|1995}} |website=IETF Datatracker }}
* {{cite IETF |rfc=2396 |title=Uniform Resource Identifiers (URI): Generic Syntax |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Roy T. |author-last2=Fielding |author-link2=Roy T. Fielding |author-first3=Larry |author-last3=Masinter |author-link3=Larry Masinter |date=August 1998 |access-date=31 August 2015 |ref={{SfnRef|RFC 2396|1998}}}}
* {{cite IETF |rfc=2396 |title=Uniform Resource Identifiers (URI): Generic Syntax |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Roy T. |author-last2=Fielding |author-link2=Roy T. Fielding |author-first3=Larry |author-last3=Masinter |author-link3=Larry Masinter |date=August 1998 |access-date=31 August 2015 |ref={{SfnRef|RFC 2396|1998}}}}
* {{cite IETF |rfc=7595 |title=Guidelines and Registration Procedures for URI Schemes |editor-first=Dave |editor-last=Thaler |author-first1=Tony |author-last1=Hansen |author-first2=Ted |author-last2=Hardie |date=June 2015 |ref={{SfnRef|IETF|2015}}}}
* {{cite IETF |rfc=7595 |title=Guidelines and Registration Procedures for URI Schemes |editor-first=Dave |editor-last=Thaler |author-first1=Tony |author-last1=Hansen |author-first2=Ted |author-last2=Hardie |date=June 2015 |ref={{SfnRef|IETF|2015}}}}
* {{cite IETF |rfc=3305 |title=Report from the Joint W3C/IETF URI Planning Interest Group: Uniform Resource Identifiers (URIs), URLs, and Uniform Resource Names (URNs): Clarifications and Recommendations |editor-first1=Michael |editor-last1=Mealling |editor-link1=Michael Mealling |editor-first2=Ray |editor-last2=Denenberg |date=August 2002 |access-date=13 September 2015 |ref={{SfnRef|Joint W3C/IETF URI Planning Interest Group|2002}}}}
* {{cite IETF |rfc=3305 |title=Report from the Joint W3C/IETF URI Planning Interest Group: Uniform Resource Identifiers (URIs), URLs, and Uniform Resource Names (URNs): Clarifications and Recommendations |editor-first1=Michael |editor-last1=Mealling |editor-link1=Michael Mealling |editor-first2=Ray |editor-last2=Denenberg |date=August 2002 |access-date=13 September 2015 |ref={{SfnRef|Joint W3C/IETF URI Planning Interest Group|2002}}}}
* {{cite IETF |rfc=3986 |title=Uniform Resource Identifiers (URI): Generic Syntax |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Roy T. |author-last2=Fielding |author-link2=Roy T. Fielding |author-first3=Larry |author-last3=Masinter |author-link3=Larry Masinter |date=January 2005 |access-date=31 August 2015 |ref={{SfnRef|RFC 3986|2005}}}}
* {{cite IETF |rfc=3986 |title=Uniform Resource Identifiers (URI): Generic Syntax |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Roy T. |author-last2=Fielding |author-link2=Roy T. Fielding |author-first3=Larry |author-last3=Masinter |author-link3=Larry Masinter |date=January 2005 |access-date=31 August 2015 |ref={{SfnRef|RFC 3986|2005}}}}
* {{cite IETF |rfc=3986 |title=Uniform Resource Identifiers (URI): Generic Syntax, section 3, Syntax Components |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Roy T. |author-last2=Fielding |author-link2=Roy T. Fielding |author-first3=Larry |author-last3=Masinter |author-link3=Larry Masinter |date=January 2005 |url=https://tools.ietf.org/html/rfc3986#section-3 |access-date=31 August 2015 |ref={{SfnRef|RFC 3986, section 3|2005}}}}
* {{cite IETF |rfc=3986 |title=Uniform Resource Identifiers (URI): Generic Syntax |section=3|sectionname= Syntax Components |author-first1=Tim |author-last1=Berners-Lee |author-link1=Tim Berners-Lee |author-first2=Roy T. |author-last2=Fielding |author-link2=Roy T. Fielding |author-first3=Larry |author-last3=Masinter |author-link3=Larry Masinter |date=January 2005 |access-date=31 August 2015 |ref={{SfnRef|RFC 3986, section 3|2005}} }}
* {{cite web |title=An Introduction to Multilingual Web Addresses |date=9 May 2008 |url=http://www.w3.org/International/articles/idn-and-iri/ |access-date=11 January 2015 |ref={{SfnRef|W3C|2008}}}}
* {{cite web |title=An Introduction to Multilingual Web Addresses |date=9 May 2008 |url=http://www.w3.org/International/articles/idn-and-iri/ |access-date=11 January 2015 |ref={{SfnRef|W3C|2008}} |archive-date=2015-01-05 |archive-url=https://web.archive.org/web/20150105041451/http://www.w3.org/International/articles/idn-and-iri/ |url-status=live }}
* {{cite web |title=What is Happening with "International URLs" |author-first=A. |author-last=Phillip |url=https://www.w3.org/International/wiki/IRIStatus |publisher=[[World Wide Web Consortium]] |date=2014 |access-date=11 January 2015 |ref={{SfnRef|W3C|2014}}}}
* {{cite web |title=What is Happening with "International URLs" |author-first=A. |author-last=Phillip |url=https://www.w3.org/International/wiki/IRIStatus |publisher=[[World Wide Web Consortium]] |date=2014 |access-date=11 January 2015 |ref={{SfnRef|W3C|2014}} |archive-date=2015-02-17 |archive-url=https://web.archive.org/web/20150217192459/https://www.w3.org/International/wiki/IRIStatus |url-status=live }}
* {{cite web |last1=Lawrence |first1=Eric |date=2014-03-06 |title=Browser Arcana: IP Literals in URLs |url=https://docs.microsoft.com/en-us/archive/blogs/ieinternals/browser-arcana-ip-literals-in-urls |website=docs.microsoft.com |access-date=22 June 2020 |url-status=live |archive-url=https://web.archive.org/web/20200622181648/https://docs.microsoft.com/en-us/archive/blogs/ieinternals/browser-arcana-ip-literals-in-urls |archive-date=22 June 2020}}
* {{cite web |last1=Lawrence |first1=Eric |date=2014-03-06 |title=Browser Arcana: IP Literals in URLs |url=https://docs.microsoft.com/en-us/archive/blogs/ieinternals/browser-arcana-ip-literals-in-urls |website=Microsoft Learn |access-date=22 June 2020 |url-status=live |archive-url=https://web.archive.org/web/20200622181648/https://docs.microsoft.com/en-us/archive/blogs/ieinternals/browser-arcana-ip-literals-in-urls |archive-date=22 June 2020 }}
{{refend}}
{{refend}}


==External links==
==External links==
* [https://url.spec.whatwg.org/ URL specification] at [[WHATWG]]
* [https://url.spec.whatwg.org/ URL specification] at [[WHATWG]]
* [https://slevithan.github.io/parseuri/demo/ URL splitter] that splits any URI into its parts
{{Hypermedia}}


{{Hypermedia}}
{{Authority control}}
{{Authority control}}


[[Category:URL| ]]
[[Category:URL| ]]
[[Category:Identifiers]]
[[Category:Identifiers]]
[[Category:Computer-related introductions in 1994]]
[[Category:Internet properties established in 1994]]

Latest revision as of 19:53, 20 June 2024

URL
Uniform resource locator
AbbreviationURL
StatusPublished
First published1994; 30 years ago (1994)
Latest versionLiving Standard
2023
OrganizationInternet Engineering Task Force (IETF)
CommitteeWeb Hypertext Application Technology Working Group (WHATWG)
SeriesRequest for Comments (RFC)
EditorsAnne van Kesteren
AuthorsTim Berners-Lee
Base standards
  • RFC 1738. – Uniform Resource Locators (URL).
  • RFC 3986. – Uniform Resource Identifier (URI): Generic Syntax.
  • RFC 4248. – The telnet URI Scheme.
  • RFC 4266. – The gopher URI Scheme.
  • RFC 6068. – The 'mailto' URI Scheme.
  • RFC 6196. – Moving mailserver: URI Scheme to Historic.
  • RFC 6270. – The 'tn3270' URI Scheme.
Related standardsURI, URN
DomainWorld Wide Web
LicenseCC BY 4.0
Websiteurl.spec.whatwg.org

A uniform resource locator (URL), colloquially known as an address on the Web,[1] is a reference to a resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI),[2][3] although many people use the two terms interchangeably.[4][a] URLs occur most commonly to reference web pages (HTTP/HTTPS) but are also used for file transfer (FTP), email (mailto), database access (JDBC), and many other applications.

Most web browsers display the URL of a web page above the page in an address bar. A typical URL could have the form http://www.example.com/index.html, which indicates a protocol (http), a hostname (www.example.com), and a file name (index.html).

History

Uniform Resource Locators were defined in RFC 1738 in 1994 by Tim Berners-Lee, the inventor of the World Wide Web, and the URI working group of the Internet Engineering Task Force (IETF),[7] as an outcome of collaboration started at the IETF Living Documents birds of a feather session in 1992.[7][8]

The format combines the pre-existing system of domain names (created in 1985) with file path syntax, where slashes are used to separate directory and filenames. Conventions already existed where server names could be prefixed to complete file paths, preceded by a double slash (//).[9]

Berners-Lee later expressed regret at the use of dots to separate the parts of the domain name within URIs, wishing he had used slashes throughout,[9] and also said that, given the colon following the first component of a URI, the two slashes before the domain name were unnecessary.[10]

Early WorldWideWeb collaborators including Berners-Lee originally proposed the use of UDIs: Universal Document Identifiers. An early (1993) draft of the HTML Specification[11] referred to "Universal" Resource Locators. This was dropped some time between June 1994 (RFC 1630) and October 1994 (draft-ietf-uri-url-08.txt).[12] In his book Weaving the Web, Berners-Lee emphasizes his preference for the original inclusion of "universal" in the expansion rather than the word "uniform", to which it was later changed, and he gives a brief account of the contention that led to the change.

Syntax

Every HTTP URL conforms to the syntax of a generic URI. The URI generic syntax consists of five components organized hierarchically in order of decreasing significance from left to right:[13]: §3 

URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment]

A component is undefined if it has an associated delimiter and the delimiter does not appear in the URI; the scheme and path components are always defined.[13]: §5.2.1  A component is empty if it has no characters; the scheme component is always non-empty.[13]: §3 

The authority component consists of subcomponents:

authority = [userinfo "@"] host [":" port]

This is represented in a syntax diagram as:

URI syntax diagram

The URI comprises:

  • A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-). Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. Examples of popular schemes include http, https, ftp, mailto, file, data and irc. URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.[b]
  • An optional authority component preceded by two slashes (//), comprising:
    • An optional userinfo subcomponent followed by an at symbol (@), that may consist of a user name and an optional password preceded by a colon (:). Use of the format username:password in the userinfo subcomponent is deprecated for security reasons. Applications should not render as clear text any data after the first colon (:) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).
    • A host subcomponent, consisting of either a registered name (including but not limited to a hostname) or an IP address. IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ([]).[13]: §3.2.2 [c]
    • An optional port subcomponent preceded by a colon (:), consisting of decimal digits.
  • A path component, consisting of a sequence of path segments separated by a slash (/). A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes (//) in the path component. A path component may resemble or map exactly to a file system path but does not always imply a relation to one. If an authority component is defined, then the path component must either be empty or begin with a slash (/). If an authority component is undefined, then the path cannot begin with an empty segment—that is, with two slashes (//)—since the following characters would be interpreted as an authority component.[16]: §3.3 
By convention, in http and https URIs, the last part of a path is named pathinfo and it is optional. It is composed by zero or more path segments that do not refer to an existing physical resource name (e.g. a file, an internal module program or an executable program) but to a logical part (e.g. a command or a qualifier part) that has to be passed separately to the first part of the path that identifies an executable module or program managed by a web server; this is often used to select dynamic content (a document, etc.) or to tailor it as requested (see also: CGI and PATH_INFO, etc.).
Example:
URI: "http://www.example.com/questions/3456/my-document"
where: "/questions" is the first part of the path (an executable module or program) and "/3456/my-document" is the second part of the path named pathinfo, which is passed to the executable module or program named "/questions" to select the requested document.
An http or https URI containing a pathinfo part without a query part may also be referred to as a 'clean URL,' whose last part may be a 'slug.'
Query delimiter Example
Ampersand (&) key1=value1&key2=value2
Semicolon (;)[d] key1=value1;key2=value2
  • An optional query component preceded by a question mark (?), consisting of a query string of non-hierarchical data. Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.
  • An optional fragment component preceded by a hash (#). The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an id attribute of a specific element, and web browsers will scroll this element into view.

A web browser will usually dereference a URL by performing an HTTP request to the specified host, by default on port number 80. URLs using the https scheme require that requests and responses be made over a secure connection to the website.

Internationalized URL

Internet users are distributed throughout the world using a wide variety of languages and alphabets, and expect to be able to create URLs in their own local alphabets. An Internationalized Resource Identifier (IRI) is a form of URL that includes Unicode characters. All modern browsers support IRIs. The parts of the URL requiring special treatment for different alphabets are the domain name and path.[18][19]

The domain name in the IRI is known as an Internationalized Domain Name (IDN). Web and Internet software automatically convert the domain name into punycode usable by the Domain Name System; for example, the Chinese URL http://例子.卷筒纸 becomes http://xn--fsqu00a.xn--3lr804guic/. The xn-- indicates that the character was not originally ASCII.[20]

The URL path name can also be specified by the user in the local writing system. If not already encoded, it is converted to UTF-8, and any characters not part of the basic URL character set are escaped as hexadecimal using percent-encoding; for example, the Japanese URL http://example.com/引き割り.html becomes http://example.com/%E5%BC%95%E3%81%8D%E5%89%B2%E3%82%8A.html. The target computer decodes the address and displays the page.[18]

Protocol-relative URLs

Protocol-relative links (PRL), also known as protocol-relative URLs (PRURL), are URLs that have no protocol specified. For example, //example.com will use the protocol of the current page, typically HTTP or HTTPS.[21][22]

See also

Notes

  1. ^ A URL implies the means to access an indicated resource and is denoted by a protocol or an access mechanism, which is not true of every URI.[5][4] Thus http://www.example.com is a URL, while www.example.com is not.[6]
  2. ^ The procedures for registering new URI schemes were originally defined in 1999 by RFC 2717, and are now defined by RFC 7595, published in June 2015.[14]
  3. ^ For URIs relating to resources on the World Wide Web, some web browsers allow .0 portions of dot-decimal notation to be dropped or raw integer IP addresses to be used.[15]
  4. ^ Historic RFC 1866 (obsoleted by RFC 2854) encourages CGI authors to support ';' in addition to '&'.[17]: §8.2.1 

Citations

  1. ^ W3C (2009).
  2. ^ "Forward and Backslashes in URLs". zzz.buzz. Archived from the original on 2018-09-04. Retrieved 2018-09-19.
  3. ^ RFC 3986 (2005).
  4. ^ a b Joint W3C/IETF URI Planning Interest Group (2002).
  5. ^ RFC 2396 (1998).
  6. ^ Miessler, Daniel. "The Difference Between URLs and URIs". Archived from the original on 2017-03-17. Retrieved 2017-03-16.
  7. ^ a b W3C (1994).
  8. ^ IETF (1992).
  9. ^ a b Berners-Lee (2015).
  10. ^ BBC News (2009).
  11. ^ Berners-Lee, Tim; Connolly, Daniel "Dan" (March 1993). Hypertext Markup Language (draft RFCxxx) (Technical report). p. 28. Archived from the original on 2017-10-23. Retrieved 2017-10-23.
  12. ^ Berners-Lee, Tim; Masinter, Larry; McCahill, Mark Perry (October 1994). Uniform Resource Locators (URL) (Technical report). (This Internet-Draft was published as a Proposed Standard RFC, RFC 1738 (1994)) Cited in Ang, C. S.; Martin, D. C. (January 1995). Constituent Component Interface++ (Technical report). UCSF Library and Center for Knowledge Management. Archived from the original on 2017-10-23. Retrieved 2017-10-23.
  13. ^ a b c d T. Berners-Lee; R. Fielding; L. Masinter (January 2005). Uniform Resource Identifier (URI): Generic Syntax. Network Working Group. doi:10.17487/RFC3986. STD 66. RFC 3986. Internet Standard 66. Obsoletes RFC 2732, 2396 and 1808. Updated by RFC 6874, 7320 and 8820. Updates RFC 1738.
  14. ^ Hansen, Tony; Hardie, Ted (June 2015). Thaler, Dave (ed.). Guidelines and Registration Procedures for URI Schemes. Internet Engineering Task Force. doi:10.17487/RFC7595. ISSN 2070-1721. BCP 35. RFC 7595. Best Current Practice. Updated by RFC 8615. Obsoletes RFC 4395.
  15. ^ Lawrence (2014).
  16. ^ T. Berners-Lee; R. Fielding; L. Masinter (August 1998). Uniform Resource Identifiers (URI): Generic Syntax. Network Working Group. doi:10.17487/RFC2396. RFC 2396. Obsolete. Obsoleted by RFC 3986. Updated by RFC 2732. Updates RFC 1808 and 1738.
  17. ^ Berners-Lee, Tim; Connolly, Daniel W. (November 1995). Hypertext Markup Language - 2.0. Network Working Group. doi:10.17487/RFC1866. RFC 1866. Historic. Obsoleted by RFC 2854.
  18. ^ a b W3C (2008).
  19. ^ W3C (2014).
  20. ^ IANA (2003).
  21. ^ Glaser, J. D. (2014-03-10). Secure Development for Mobile Apps: How to Design and Code Secure Mobile Applications with PHP and JavaScript (1st ed.). CRC Press. p. 193. ISBN 978-1-48220903-7. Retrieved 2015-10-12.
  22. ^ Schafer, Steven M. (2011). HTML, XHTML, and CSS Bible (1st ed.). John Wiley & Sons. p. 124. ISBN 978-1-11808130-3. Retrieved 2015-10-12.

References