URL

Several HTML elements, most notably th A element, may contain an attribute which takes a URL as value. URLs, Uniform Resource Locators, are addresses of Web documents. More generally, URLs can be used on the Web to refer to "objects"on the Web or in other information systems

The general syntax of absolute URLs is the following:

scheme://host:port/path/filename

wher

scheme
specifies the information system (technically speaking, th protocol)to be used to access the resource;possible values include the following:
httpa Web document (to be accessed using Hypertext Transfer Protocol HTTP)
ftpa resource to be retrieved using FTP(File Transfer Protocol), usually a file in a so-called FTP server,
filea file on a particular computer; fileURL is hardly useful on the Web
gophera file in a Gopher server
mailtoelectronic mail address
newsa newsgroup or an article in Usenet news
telnetfor starting an interactive session via the Telnet protocol (which is part of TCP/IP)
host
is the Internet host name in the domain notation, e www.hut.fi(or sometimes a numerical TCP/IP address);notice that typically, but not necessarily, Web servers have domain names starting wit www
:port
is the port number part, which can usually be omitted since it has a reasonable default;that is, omit it, unless it is a part of a URL which you got somewhere (or you really know what you are doing)
path
is a directory path within the hos
filename
is a file name within the directory

Warning:Although many browsers allow you to omit the par http://when specifying the URL of a document to be visited, you must not omit it in when writing a normal URL into an HTML document. (Otherwise browsers will try to interpret it as a relative URL.)

Actually, this pattern is mainly for Web documents, i httpURLs. For other URLs, simplifications and special interpretations are applied. For example, mailtoURL is just of the for mailto:addresswher addressis a normal Internet E-mail address lik [email protected](as specified i RFC 822). Please notice that appending anything to the E-mail address in mailtoURL is nonstandard and may result in lost mail without anyone noticing! (See also the discussion o mailto:URLs in the description of th Aelement.)

A httpURL can also be fragment identifierwhich consists of an absolute URL, the # sign and name(which refers to a location within the document specified by the absolute URL). See the description of th Aelement for more information

It is safest to enclose URLs i quoteswhen writing them as attribute values in HTML

For an overview of URLs, se W3C material on addressing

As regards to thetechnical specifications of the syntax of URLs, se RFC 1738(absolute URLs)an RFC 1808(relative URLs)

In particular, the specificationssay that within a UR only a limited set of characters can be used as such:

Other characters must be encoded. (The character ;/?:@=&#must also be encoded, if they are not used in the special meaning.)This encoding (which is defined by URL specifications, not HTML specifications)consists of using the percent sign followed by two hexadecimal digits, presenting the code position. For example, tilde (~)should be presented a %7Eand space a %20. (Violating the rules causes problems much more likely in the latter case than in the former.)

When a URL occurs as anattribute valuein HTML, there is another complication caused by th &character which may have special use in quer formsubmissions. In principle, that character should b escapedas &or as &(there i a footnotein th HTML 2.0specification about this)and browsers should process it so that the actual URL passed to the processin CGI scripthas that notation replaced by plain &character. (Notice that it mus notbe encoded. This is a confusing issue, and CGI scripts should really be written so that semicolon ;and not ampersand &is used as field separator.)