Javatpoint Logo
Javatpoint Logo

Define URL in Computer Networks


The URL, or uniform resource locator, is one of the most fundamental ideas that supports our daily internet experience amid the wide expanse of computer networks. A URL is used as an internet address to find resources on the World Wide Web and is essential to the operation of the Internet. This in-depth tutorial will examine the significance of URLs in computer networks and their definition, components, structure, and history.

Definition of URL

A URL, also known as a uniform resource locator, is a web address used to identify and find resources on the Internet. These resources can be any digital content available through the World Wide Web, including web pages, files, photos, videos, and other media. A URL is a reference or pointer to a certain resource, enabling users and web browsers to get the desired material.

As the Internet expanded quickly, URLs were established as a standard navigation method, offering a dependable and user-friendly method of accessing content across various platforms and servers. An essential component of current internet usage, URLs are required for the smooth operation of web browsers, search engines, and the overall web infrastructure.

Parts of URL

A URL comprises various parts, each used to locate and identify a particular site. Together, these elements make up a complete URL. These are a URL's essential elements:

1. Scheme:

The scheme indicates the technique or protocol used to access the resource, also called the protocol. It provides instructions on how to retrieve the resource. Typical plans include:

  • Http: Hypertext Transfer Protocol, used for standard web pages.
  • Https: Secure Hypertext Transfer Protocol, a secure version of HTTP.
  • Ftp: File Transfer Protocol, used for transferring files.
  • File: Specifies a file on the local system.
  • Mailto: Used for email addresses.
  • Tel: Used for telephone numbers.
  • Data: Data URLs used to embed data in web pages.

A colon and two slashes (such as 'http://' or 'https://') are placed after the scheme.

2. Host:

The host component identifies the precise server or computer where the resource is located. Usually, it appears as a domain name or IP address. For instance, '' is the host when the URL is ''.

3. Port:

The port, a supplementary element that is optional, specifies the network port number to use when connecting to the host. The chosen scheme's default port is utilized if it is absent. For instance, the default port for HTTP is 80, while the default port for HTTPS is 443.

4. Path:

The path component specifies the resource's host server location or file path. It frequently has a directory-like structure. For instance, the route is '/products/index.html' in the URL ''.

5. Inquiry:

If present, the query component gives the resource additional parameters or data to be supplied. It is frequently used to provide user input or other data to web application servers. Multiple key-value pairs may be included in the query component, which begins with a question mark ('?') and is delimited by ampersands ('&'). For instance, the query 'is?q=url+encoding' in the URL ''.

6. Identifier for a Fragment:

The fragment identifier, the anchor or fragment, designates a particular area or position inside the resource. A hash sign ('#') comes before it. In web pages, fragment identifiers frequently jump to a particular piece of a lengthy article. For instance, the fragment identifier for the URL ' is #team'.

URL Encoding

URLs can only contain a few characters, mostly alphanumeric and special ones like underscores, hyphens, periods, and tildes. URL encoding includes characters not part of this set, including spaces or non-ASCII characters.

When encoding a URL, unsafe or reserved characters are changed to two hexadecimal digits corresponding to the character's ASCII code, followed by a percent sign. For instance, the letter "" is encoded as '%C3%A9', and spaces are encoded as '%20'. This encoding ensures that URLs are still valid and properly decoded by web servers and browsers.

URL encoding is essential when delivering data through a URL's query component or incorporating special characters.

Types of URL

URLs are not just for websites. Depending on the employed system, they are used in different circumstances and for different objectives. Following are a few popular URL types:

1. URLs in HTTP and HTTPS:

The most prevalent URL formats on the Internet are HTTP (Hypertext Transfer Protocol) and HTTPS (HTTP Secure). They are employed to gain access to online resources and web pages. URLs for HTTP normally begin with 'http://', while those for HTTPS often begin with 'https://'.

2. FTP URLs:

File transfers over networks are done using FTP (File Transfer Protocol) URLs. They are frequently used to download files from FTP sites and begin with 'ftp://'.

3. File URLs:

Files on a network share or the local file system are referred to using file URLs. They are frequently used in web development to access local resources and begin with 'file://'.

4. Email URLs:

The creation of emails with a specific recipient, subject, and body is started by using email URLs. They frequently appear on web pages as "mailto" links that open the user's default email client since they begin with 'mailto:'.

5. Individual Protocols:

Because URLs may be extended, programmers can create unique app protocols. For instance, mobile apps may employ a bespoke URL scheme to launch the app and carry out particular tasks.

Functions of URL in Computer Networks

In computer networks and on the World Wide Web, URLs perform several crucial tasks:

  • Resolution of URL:
    URL resolution is carried out by the browser or application whenever a user or application inputs a URL into a web browser or when a URL is used to make a network request. To connect to the correct server, this procedure includes disassembling.
    The URL is into its parts, such as scheme, host, path, and query. The basis for web navigation and resource retrieval is URL resolution.
  • Hyperlinking:
    A key component of the Web, hyperlinks depend on URLs to work. An element on a website that may be clicked on and, when done so, directs the user to another website or resource is known as a hyperlink. Users can smoothly switch between various websites and online pages thanks to these linkages, which are made possible by URLs.
  • Orientation:
    The key to navigating the Web is URLs. To access web pages, documents, multimedia, and other resources, users enter URLs or click on links that include URLs. The Web as we know it would only exist with URLs because there would be no standardized mechanism to identify the locations of resources.
  • Data Recovery:
    Data from distant servers is retrieved via URLs. A user's browser sends a request to the server listed in the host component when accessing a web page using the URL. The server returns the requested data in response, and the browser then renders it. This procedure applies to all web content formats, including text documents, photos, and videos.

The Development of URL

The idea of URLs has changed throughout time to consider user needs and the shifting internet environment. The following are some significant changes in the history of URLs:

  • Standardization of URLs:
    Tim Berners-Lee, the creator of the World Wide Web, established the first URL standard in 1994. The structure and syntax of URLs we use today were established because of this standardization. Developing protocols like HTTP and FTP was a critical milestone in organizing web resources.
  • Internationalized Resource Identifiers (IRIs):
    Non-ASCII characters in URLs had to be supported to accommodate many languages and scripts as the Internet became more widely used. Because of this, internationalized resource identifiers (IRIs), which expand URL encoding to support more characters, were created. Websites and other online materials in non-Latin scripted languages require IRIs in particular.
  • Services for Shortening URLs:
    URL shortening services were created in response to the growth of social media and the demand for brief link sharing. Long URLs are transformed into shorter variants using these services. Although useful, they posed link transparency and security issues because users needed help determining where a shortened URL led.
  • App URLs and Deep Linking:
    Deep connections arose as the use of mobile apps increased. Deep links are URLs that connect users to a specified point within the program instead of just launching a mobile app's home screen. This allows online content and app functionality to switch over smoothly.
  • URLs and QR codes:
    QR (Quick Response) codes are two-dimensional barcodes that, among other information, may encode URLs. It is simple to exchange URLs in physical form, such as on printed materials or product packaging, by scanning a QR code with a smartphone's camera.
  • PWAs (Progressive Web Apps):
    Progressive Web Apps are web applications that give a native app-like experience and may be accessed using URLs. Like conventional apps, they are downloaded and run on the user's device but distributed via the Internet. When launching and using PWAs, URLs are essential.

Security of URL

The security of web browsing and online interactions depends heavily on URLs. They are, nevertheless, frequently used as a conduit for numerous security threats and assaults. Following are some URL security considerations:

  • Phishing:
    Phishing attacks frequently use misleading URLs that look like trustworthy websites or services. Users may be fooled into inputting personal information on fraudulent websites that look genuine. Users must always check the legitimacy of URLs before entering sensitive data or login credentials.
  • URL Spoofing:
    Attackers who change URLs to make them look to come from a reliable source are said to engage in URL spoofing. Users may unknowingly browse hazardous websites or download harmful content due to this. Browsers put Security safeguards in place to alert users to potentially dangerous URLs.
  • URL Redirection:
    Websites and services employ the method of URL redirection to move users from one URL to another. Malicious redirections send consumers to dangerous websites even though they are legitimate for many purposes. Modern browsers implement protections to stop harmful redirections.
  • Security for URLs and HTTPS:
    By encrypting data sent between a user's browser and a web server, the introduction of HTTPS (HTTP Secure) substantially improved URL security. Users are advised to check the URL bar of their browser for the padlock icon to ensure the website they are viewing utilizes HTTPS.
  • URL Safelisting and Denylisting:
    Organizations and network managers frequently use URL filtering and categorization to restrict access to particular websites. Enforce security policies; this entails maintaining lists of permitted (safe listed) and forbidden (delisted) URLs.
  • Short URLs and Credibility:
    Services that shorten URLs have sparked questions about openness and trust. Users are advised to exercise caution when clicking on shortened URLs, especially if the source is unidentified. Several services provide previews so users can see the final URL before clicking.


A fundamental component of computer networks, uniform resource locators (URLs) allow users and programs to find and access resources on the internet and local networks. They comprise several parts, each of which serves a particular function. These include the scheme, host, port, path, query, and fragment identifier.

Over time, URLs have changed to meet the ever-evolving requirements of the Internet, from standardizing web addresses to enabling internationalization and deep linking in mobile apps. They are essential for app integration, data retrieval, hyperlinking, and online navigation.

Because URLs can be exploited in phishing attacks and URL spoofing, among other cyberattacks, security is a crucial component of URLs. HTTPS adoption and user education on URL security are necessary for safer web browsing.

URLs will probably continue to be a crucial part of accessing and interacting with digital resources as the Internet develops. Anyone traversing the world of computer networks and the Web must comprehend its structure and significance.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA