0% found this document useful (0 votes)
4 views3 pages

Everything About URL

A URL (Uniform Resource Locator) is the address used to identify resources on the web, consisting of components such as scheme, host, port, path, query string, and fragment. URLs can be absolute, containing the full path, or relative, specifying a path relative to the current page. Proper URL encoding is necessary for safe transmission of special characters.

Uploaded by

cloud.domain23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Everything About URL

A URL (Uniform Resource Locator) is the address used to identify resources on the web, consisting of components such as scheme, host, port, path, query string, and fragment. URLs can be absolute, containing the full path, or relative, specifying a path relative to the current page. Proper URL encoding is necessary for safe transmission of special characters.

Uploaded by

cloud.domain23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Everything About URL

What is a URL?

 URL (Uniform Resource Locator) is the address used to identify


resources on the World Wide Web (e.g., https://www.example.com).

 A URL tells the browser where and how to access a specific resource
(such as a webpage, image, or file) on the internet.

Structure of a URL:

A URL typically consists of the following components:

1. Scheme (Protocol):

o Defines the protocol used for communication.

o Examples: http://, https://, ftp://, mailto:.

o Example: https:// (HTTPS for secure browsing).

2. Host (Domain Name or IP Address):

o The domain name (like www.example.com) or IP address of


the server that hosts the resource.

o Example: www.example.com.

3. Port (Optional):

o Defines the port number used for communication between the


client and server (typically not visible in the URL unless non-
standard ports are used).

o Default ports: 80 for HTTP, 443 for HTTPS.

o Example: :8080.

4. Path:

o Specifies the exact location of the resource on the server.

o It refers to the file or directory on the server.

o Example: /about or /images/logo.png.

5. Query String (Optional):


o Used to pass parameters to the server for dynamic content,
often seen in web applications.

o Begins with ? and contains key-value pairs separated by &.

o Example: ?id=123&name=John.

6. Fragment (Optional):

o Refers to a specific section or anchor within the resource (like a


specific part of a webpage).

o Begins with #.

o Example: #section2.

Full URL Example:

bash

Copy

https://www.example.com:443/about?id=123#section2

 https: Scheme (uses HTTPS protocol).

 www.example.com: Host (domain name).

 443: Port (default for HTTPS, often omitted).

 /about: Path (the specific resource on the server).

 ?id=123: Query string (parameters for the server).

 #section2: Fragment (specific section on the webpage).

URL Types:

1. Absolute URL:

o Contains the full path to the resource, including the protocol,


domain, and other components.

o Example: https://www.example.com/products?id=1.

2. Relative URL:
o Specifies a path relative to the current page or domain, often
used within a website.

o Example: /about (refers to /about on the current domain).

URL Encoding:

 Some characters in URLs (like spaces or special characters) need to be


encoded to ensure proper transmission. This is called URL encoding
or percent encoding.

 Spaces become %20.

 Special Characters like &, ?, and =, are encoded for safe transfer in
query strings.

Common URL Schemes/Protocols:

 http://: HyperText Transfer Protocol (non-secure).

 https://: Secure HyperText Transfer Protocol (encrypted via SSL/TLS).

 ftp://: File Transfer Protocol (used for file transfers).

 mailto:: Opens the default email client with a new email.

 file://: Refers to local files on the system.

Key Points About URL:

1. URL is the address that specifies the location of resources on the


web.

2. It includes protocol, host, path, query string, and fragment.

3. URLs can be absolute (full path) or relative (partial path).

4. Query strings pass parameters for dynamic content.

5. URL encoding ensures safe transmission of special characters.

You might also like