HTML URL-Uniform Resource Locators

42 Views
No Comments

A URL is a web page address.

A URL can be made up of letters, such as “it-res.com”, or an Internet Protocol (IP) address: 1.1.1.1. Most people access a website using its domain name because names are easier to remember than numbers.

URL – Uniform Resource Locator

A web browser requests a page from a web server via a URL.

When you click a link in an HTML page, the corresponding <a> tag points to an address on the World Wide Web.

A Uniform Resource Locator (URL) is used to locate a document on the World Wide Web.

An example of a web page address: https://www.it-res.com/en/html-paragraph.html Syntax rules:

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

illustrate:

  • scheme – defines the type of Internet service. The most common type is http
  • host – defines the domain host (the default host for http is www)
  • domain – defines the Internet domain name, such as www.it-res.com
  • :port – defines the port number on the host (the default port number for http is 80)
  • path – defines the path on the server (if omitted, the document must be in the root directory of the website).
  • filename – defines the name of the document/resource

Common URL Schemes

Here are some URL schemes:

Scheme access Used for…
http Hypertext Transfer Protocol A normal web page starting with http://. No encryption.
https Secure Hypertext Transfer Protocol Secure web page, encrypting all information exchanged.
ftp File Transfer Protocol Used to download or upload files to the website.
file   Files on your computer.

URL character encoding

URLs can only use the ASCII character set .

Because URLs often contain characters outside the ASCII set, URLs must be converted to valid ASCII format.

URL encoding uses “%” followed by two hexadecimal digits to replace non-ASCII characters.

URLs cannot contain spaces. URL encoding typically uses + to replace spaces.

Online Instance

If you click the “Submit” button below, the browser will URL-encode the input before sending it. The page on the server will display the input received.

Try entering some characters and clicking the Submit button again.

URL Encoding Example

character URL encoding
%80
£ %A3
© %A9
® %AE
À %C0
Á %C1
 %C2
à %C3
Ä %C4
Å %C5
END
 0
Comment(No Comments)