Have you ever wondered what all the text that appears in the url bar when you search for something on the internet or browse a website means? It is called a Uniform Resource Locater or URL for short.
What is a URL?
URL is a short form for Uniform Resource Locator. A URL, as the name suggests, is an address of a resource on the internet. A resource can be anything, be it an image or text document or HTML document of the website you type the URL of.
https://www.google.com/search?q=Internet
The above url if typed in the url bar will load HTML page containing search results for Internet.
Anatomy of a URL
A URL is made of many different parts and I will try to explain most of them in here using the following URL.
https://www.zainsci.github.io/blog/day-20/?key=value#heading
Protocol
The first part of a URL is the protocol which a browser uses as a method for sharing and transferring data within a computer network.
In this case the protocal a browser uses for website is http:
(Hyper Text Transfer Protocol) protocol. In modern browsers you don't have to type the protocol yourself because the browser adds it in the beginning automatically. Some other protocols that the browser uses are file:
for opening local files, mailto:
to open a mailing client. In the above mentioned URL the used protocol is https
which a better more secure version of http
where s means secure.
Domain Name
A Domain Name is human readable address to a specific IP (Internet Protocol) Address of a web-server. You type the domain name and the DNS (Domain Name Server) will translate the domain name to it specofied IP Address. The .com, .org, .tech and other like these are called Top Level Domains (TLD).
Path to File
Next comes the path to the file you want to access on the web-server. The section after the TLD is the up to a Question Mark or A Hash is a path to the file. In this case /blog/index.html
is the path to index.html file.
Parameters
Parameters in a URl are key-value pairs followed by ?
separated by &
symbol. Web Server uses these parameters to do some extra stuff.
?key1=value1&key2=value2
Anchor
Anchors are used to navigate to a specific part the page that loads after you type the URL.
heading <-- Click This
When you clicked the above link the URL in the url-bar changed adding #heading in front of the currnet URL.
Another example is on this article on Wikipeida. When you open the link it will load the page and will take you to the section that is specified in the URL after the #
symbol.
So here you go that is all that I can think of right now about URLs.
What I Learned Today
💻 Porgramming
- URL (Uniform Resource Locater) - Some sources to get deep into the Study.
🗾 Langauge[日本語]
- 戦鎚 (せんつい) War Hammer. 戦: Riot or War,
鎚: Hammer. - 安心 (あんしん) Peace of Mind. 安: Relax, 心: Heart.
- 案 (あん) Proposal.
- 文学 Literature. 文: Writing, 学: Study.