What Is URL (Uniform Resource Locator)? – POFTUT

What Is URL (Uniform Resource Locator)?

Uniform Resource Locator a.k.a. URL is a resource naming or locating format used to specify or address the resource. URL is very popular with the web where web sites and web resources are addressed or identified with URL format.

URL Syntax

URL has a very strict syntax which is defined in RFC 1738. It has the following syntax where some information about the resource is provided.

  • scheme is the protocol used to retrieve the URL resource which is generally HTTP, HTTPS, FTP
  • location is the address of the resource which generally starts with the www to specify the web resources
  • port is the port number of the resource which is generally omitted because schemes has default port numbers those will be used implicitly. HTTP is 80, HTTPS is 443 etc.
  • file-on-server.htm is the resource name which is generally an HTML, JAVASCRIPT, CSS, IMAGE etc.
  • querystring is a parameter provided to the resource which is used to put some data about the request.

As an example, this syntax is implemented in the following example.

  • https is the scheme or protocol we will use to communicate with the location or server
  • www.poftut.com is the location or server we will communicate
  • what-is-chmod-777 is the resource we want to get and use

We can see this example do not provide a port or query string as the port is default value provided by HTTPS – 443 and there is no query string as we do not need for this case

Scheme

The scheme is the protocol we will use during communication with the remote server or location. There are different schemes invented on the internet. Below we will example most popular of them below.

  • HTTP is the main and most popular protocol used as scheme. HTTP simply used to send a request to get remote resource which is generally an HTML, JAVASCRIPT, CSS, IMAGE etc. HTTP is a stateless protocol where every request has to be managed separately by HTTP server like Apache, Nginx
  • HTTPS is another popular protocol and expected to be the most popular protocol in the next years. HTTPS is just an HTTP protocol secured with the SSL.
  • FTP or File Transfer Protocol is a very old protocol which is used to transfer files or bulk data between server and client.
  • TELNET is interactive remote management protocol which provides a shell for the remote system. TELNET is generally used to management systems and network devices

Location

Location is the address of the remote system. Location can be also named as a server as a remote system will serve its resources to the client. Location can be expressed in different ways like below.

Domain Name

Domain name is used to address a specific location or system. Domain names are used via Domain Name System or DNS. Computer networks work with IP Addresses. But as human beings, we need a more simple solution to name and use systems. We can name systems with domain names in human-readable format. We can use the following names as domain or location name in URL

Ip Address

Ip Address is four octet value which is delimited with the points like 192.168.1.2. IP addresses are used to address systems in a computer network. So we can use an IP address as a location like below. In this example, we will set the location as 192.168.1.1 with the HTTPS scheme.

Ipv6 Address

IPv6 is a newer version of IP Address. We can use IPv6 address the same as IP address.

Port

Port is used to specify the location TCP or UDP port number. But TCP is the most popular port number with the HTTP, HTTPS protocols. Port numbers are generally used implicitly with the scheme or protocol like HTTP, HTTPS, FTP. So we do not provide port number explicitly. So following examples are the same request or URL

https://www.poftut.com/

https://www.poftut.com:443/

But we can specify the port number explicitly. In this example, we will specify the port number as 81 .

Here are some protocols/schemes and defacto port numbers.

  • HTTP – 80,8080
  • HTTPS – 443
  • TELNET – 23
  • FTP – 21
  • LDAP – 389

Resource

A resource is the specific name of the resource we want to use on the remote location or server. The resource can be an HTML file, CSS file, JAVASCRIPT file, IMAGE file, PHP file, BATCH commands to run, API etc. In regular usage, it will be a web page or HTML file. In this example, we will get the resource named run_command.html

Query String

When we request a resource can provide some Query String. Query String can be used to provide special parameters to a resource request. For example, if we want to use / on poftut.com with the word linux wecan use we can string like below. The query string key will be s and value will be linux like below.

Providing User Name and Password.

Up to now, we have used location as a DNS name or IP address. But if we need to specifically use a user name and passwords we can use following sytnax.

scheme://username:password@location:port/resource?querystring

  • username is used to specify the user like ismail, john, admin
  • password is used to put the password of the user where we need authentication to use specified URL or resource.

Username and password generally required in the HTTP, HTTPS and FTP protocols to use the remote resource. In this exapmle, we will authentication with the admin user and password 34qFQwer4r+

HTTP URL Examples

In this part, we will provide different HTTP URL examples.

HTTPS URL Examples

In this part, we will provide different HTTPS URL examples.

Mail URL Examples

In this part, we will provide different Mail URL examples.

FTP URL Examples

In this part, we will provide different FTP URL examples.

What Is URL (Uniform Resource Locator)? Infographic

What Is URL (Uniform Resource Locator)? Infographic

What Is URL (Uniform Resource Locator)? Infographic

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)