Javatpoint Logo
Javatpoint Logo

URL Definition

A URL is a special identifier that can be used to find a site online. Uniform Resource Locator is the full form of URL. It is additionally known as a web address. URLs comprise several components, including a protocol and a domain name. A URL tells a web browser how and from where to retrieve a resource.

URL Definition

End users can access the site by putting the URL into the address bar of their browsers or by clicking a hyperlink. Owners of websites can change their URLs. A carefully constructed URL can be an effective tool for enhancing user experience, which can boost search engine optimization (SEO) performance.

Syntax of URL:

scheme://sundaomin.domain: port/path/filename

Example:

https://www.fruits.com/Allfruits/list-out-friuts-name

Parts of the URL

The scheme, subdomain, domain, top-level domain, port number, path, query, parameter and fragment are the components of a URL.

1. Scheme

All URLs start with the scheme. The scheme specifies the protocol to access the resource on the internet. The scheme denotes the protocol that the browser utilizes to request the resource. The most popular URL scheme are listed below.

  1. HTTP: HTTP is used to send data across the internet. Browsers use it to exchange messages with web servers to access web pages. When the input URL starts with "http" in the address bar, the web browser sends a request to the server that utilizes HTTP protocol. HTTP is a stateless protocol that does not keep a constant connection between the client and the server. Each request and response are handled as separate transactions.
  2. HTTPS: A secure variant of the HTTP protocol is HTTPS. It is frequently utilized to access websites that contain private data. Your web browser creates a secure connection with the server using the SSL / TLS protocol whenever you input a URL that starts with "https" in the address bar.
  3. FTP: FTP is used for online file transfers. It is frequently used to upload and receive files from a server. A subdomain establishes a unique site entity that enables using a different website style and content organization. The FTP client creates a connection to the server and enables you to browse its files and directories and upload and download files.
  4. Mailto: The "mailto" URL scheme is utilized to make a link that opens the default email client and generates a new email message with the "To" field. After that, the user can add a subject and message in the body and send the email as usual.
  5. Tel: The "tel" URL scheme generates a link to place a call. The phone number is formatted per the E.164 specification, including the nation code, area code, and local numbers.
  6. Sms: The "sms" URL scheme generates a link to send a text message. The format for SMS URLs is "sms:<phone>", where <phone> is an optional parameter that specifies the destination phone number of the SMS message.
  7. Skype: The "Skype" URL scheme is utilized to generate a Skype conversation link.

2. Subdomains

Any words or phrases before the first dot in a URL are called subdomains. Subdomains are excellent for organizing information on the site to improve the user experience. The most widely used subdomain is www. Subdomains help to manage your website. Subdomains allow users to locate and access content more rapidly. Most websites have a responsive layout for different platforms, but you can also add a mobile-specific website with a subdomain.

3. Domain

The domain is the name of a website. It is a symbolic word connected to an IP address. Users enter a domain name into their browser's address bar to access a website. The domain name is a different or special name for recognizing the website. Domain names come after the (@) in email addresses and after the (www.) in web addresses.

Many domain names are available, some are generic (com, edu, gov, net, etc.), and others are country-level (au, in, za, us, etc.).

The generic top-level domain names are listed in the chart below:

Domain Name Meaning
1. Mil U.S. military
2. Net Networking organization
3. Edu Education
4. Int International entity
5. Com Commercial business
6. Gov U.S. government agency
7. Org Non-profit organization

The top-level domains for every nation are listed in the chart below:

Domain Name Meaning
1. za South Africa
2. in India
3. de Germany
4. fr France
5. us United States
6. uk United Kingdom
7. cl Chile
8. jp Japan
9. au Australia
10. ca Canada
11. es Spain
12. ee Estonia
13. hk Hong Kong

Guidelines to Buy the Domain

1. Check the Availability of the Name

You can use a checker to search for the name to verify whether the name is available.

  • Enter the name and extension you want to use.
  • Click on the search
  • It will give you a list of available names.

2. Continue to Checkout

You need to select the registration period in this step. Usually, registrars require a minimum of one year period. Some registrars provide up to ten years of registration time.

i) Complete the Registration Procedure

Once the payment has been approved, the registrar will ask you to complete a setup form with details such as your name, email address, home address, and phone number.

ii) Verify Domain Ownership

After completing the registration procedure, you will receive the verification link in the email. You can submit a request from the control panel if you do not receive the verification link.

4. TLD

The part of a website name that comes after the dot is known as a top-level domain (TLD).

TLD Extension Types

  1. Generic TLD (gTLD): Most well-known extensions, such as .com, .org, and.net, are included in this group.
  2. iCountry Code TLD (ccTLD): TLD denotes a nation, a territory, or a region. ccTLDs are letters based on international country codes like .uk,.in, and. sg.
  3. Sponsored TLD (sTLD): Particular organizations utilize this kind of extension. For example, '. app' is a TLD designated for the developer community.

5. Port Number

The port is a reserved channel that is utilised for particular purposes. Different servers will utilise various ports. The resources on the server are accessible by browsers only when they are connected to a specific port. The default port for HTTP servers is 80.

6. Path

It is frequently referred to as the website's folder structure. The path indicates which directory on the server contains the requested resources (files, movies, audio, etc.). A web server can direct users to a particular location by using the path to the resource.

7. Query

The query is found in dynamic web pages' URLs. The query comprises a question mark and then a list of parameters.

8. Parameter

A parameter is a query string or a variable in a URL. They are part of a URL that comes after the question mark. Keys and values in parameters are separated by the equal symbol (=). Ampersands (&) symbol is used to separate many parameters.

Parameter Use Cases

  • Translating: A country code in the query string translates a web page into the language associated with the nation.
  • Searching: The search parameter displays search results from a website's private search engine.
  • Filtering: Site owners can utilize the filtering parameter to divide various fields, like the topic, colour, price range, and region.
  • Tracking: Tracking typically includes the Urchin Tracking Module codes to monitor traffic from advertisements and marketing efforts.

9. Fragment

The fragment is the last part of a URL. The fragment is an optional element of a web URL that begins with the hash (#) symbol, which refers to a secondary resource. The secondary resource is the website section is like a footer or a sidebar.

Types of URL

1. Absolute URL

An absolute URL provides precise location details. It starts with a procedure like "http://" and goes on with all the specifics. Absolute URLs give all the details needed to locate a website, including its location.

Syntax: protocol://domain/path

2. Relative URL

The relative URL only includes the path and not the domain name. Relative refers to "in relation to," so a relative URL describes a location in terms of the present location. A relative path refers to an internal connection to a file within the same domain.

3. Canonical URL

A canonical URL aids web crawlers and search engines figure out which version of a web page should be indexed and shown in search engine results. It is crucial because it aids in avoiding problems with duplicate content that might negatively impact a website's search engine visibility. It also helps to ensure the most important web page version is indexed and shown in SERPs.

4. Callback URL

Callback URLs point to a main location when users finish a task on an external system.

5. Vanity URL

Vanity URLs are also referred to as custom short URLs. A vanity URL is a one-of-a-kind web address that has been customized for marketing uses. Vanity URLs make it easier for visitors to recall and locate a particular website page. Vanity URLs should be simple to recall, use, and share. Owners of websites can create a vanity URL using a website url shortener utility like Bitly, Short.io, or TinyURL.

FAQs on URL

1. Are canonical URLs essential?

Answer:

No, canonical URLs are not essential. Search engines and web crawlers utilize URLs to determine which version of a web page to display in search results, but they are unnecessary. Search engines can locate and index your web page without using a canonical URL, but there might be problems with duplicate material.

2. Where is a URL located?

Answer:

A URL is located in the address bar at the top of a web browser's window. A website URL will always be available in the address bar on laptops and desktop computers when users scroll through the web page. On mobile devices, a URL disappears as soon as users begin scrolling down due to the default browser behaviour. When users scroll up, it will reappear.

3. Why use absolute URL?

Answer:

  • Makes it difficult to copy your website: Cybercriminals utilize cloned websites to defraud consumers of businesses. They utilize scraping tools, which browse and replicate the content of websites, to produce clones. Absolute URLs make it more challenging for them to carry out this.
  • Avoids duplication of information: Duplicate website material can harm your site's ranking and SEO. Absolute URLs aid in avoiding identical content problems.
  • Aids in search engine indexing: Search engine crawlers utilize internal links for indexing websites. Absolute URLs make it simpler for search engine crawlers to index your website rapidly.

4. Why use relative URLs?

Answer:

  • Faster Coding: When you convert your URL to a relative format, it becomes much simpler to write for large websites.
  • Internal linking: Only sites that share the same root directory can be linked to using relative URLs.
  • Simple to deal with various environments: Relative URLs make it simple to operate in various environments. Relative URLs reduce the need to refresh links when syncing various environments.

5. Difference between URI and URL.

Answer:

URL URI
1) Uniform Resource Locator is the full form of URL 1) Uniform Resource Identifier is the full form of URI.
2) A resource's location and method of retrieval are specified by its URL. 2) A URI uses the URL or URN to identify an entity.
3) It includes the scheme, authority, route, query, fragment component, etc. 3) It includes protocols, domains, routes, hash, query string, etc.
4) Every URL can be a URI. 4) Not all URIs are URLs.
5) Example: https://google.com 5) Example: urn:isbn:0-985-64231-5

6. What is SEO?

Answer:

Search engine optimization is a full form of SEO. It's a collection of procedures designed to increase the ranking of your website in search engines. Its objective is to increase incoming traffic. SEO aims to satisfy users' search requirements by producing high-quality content and offering the best user experience.

7. Difference between a relative URL and an absolute URL.

Answer:

Relative URL Absolute URL
1. Utilized to connect pages within the same website 1. Utilized to connect pages on various websites
2. Relative URLs are simple to handle 2. Absolute URLs are difficult to handle.
3. The relative URLs remain the same even if the host or directory names are changed 3. The absolute URL will also change if the host or directory names are changed.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA