What is a URL?
URL is an acronym for Uniform Resource Locator and is a reference (an address) to a resource on the Internet. The unique address of any Web document. The following is an example of a URL which addresses the Java Web site hosted by Sun Microsystems:
As in the previous diagram, a URL has two main components:
- Protocol identifier
- Resource name
Note that the protocol identifier and the resource name are separated by a colon and two forward slashes. The protocol identifier indicates the name of the protocol to be used to fetch the resource. The example uses the Hypertext Transfer Protocol (HTTP), which is typically used to serve up hypertext documents. HTTP is just one of many different protocols used to access different types of resources on the net. Other protocols include File Transfer Protocol (FTP), Gopher, File, and News.
The resource name is the complete address to the resource. The format of the resource name depends entirely on the protocol used, but for many protocols, including HTTP, the resource name contains one or more of the components listed in the following table:
|Host Name||The name of the machine on which the resource lives.|
|Filename||The pathname to the file on the machine.|
|Port Number||The port number to which to connect (typically optional).|
|Reference||A reference to a named anchor within a resource that usually identifies a specific location within a file (typically optional).|