URL & URI | Learn HTML
URL stands for Uniform Resource Locator. It is the global address of documents and other resources on the World Wide Web. A URL is one type of Uniform Resource Identifier (URI).
URI (Uniform Resource Identifier)
Is the generic term for all types of names and addresses that refer to objects on the World Wide Web.
The term “Web address” is a synonym for a URL that uses the HTTP or HTTPS protocol. Here are few examples:
- http://mydomain.com
- http://mydomain.com/myresource.html
Parts of URL:
The first part of the URL is called a protocol identifier and it indicates what protocol to use.
http://mydomain.com/myresource.html
The second part is called a resource location name and it specifies the IP address or the
domain name where the resource is located.
http://mydomain.com/myresource.html
The third part is optional; it’s the resource name, typically a file name on server.
Dynamic URL:
A dynamic URL is the address of a dynamic Web page. Dynamic URLs often contain the characters.
Like: ?, &, %, +, =, $, cgi-bin
http://mydomain.com/myres.php?fname=Asim
There is a fourth optional part for dynamic URL. It contain the parameters sent to the dynamic page, in key=value pair. ?fname=Asim&job=Software%20Engineer
URL Encoding:
URLs can only be sent over the Internet using the ASCII character-set.
Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a “%” followed by two hexadecimal digits. URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.
