Why do we use URLs?
A Unique Resource Locator or URL for short, is a map to a particular file or directory, they crop up all throughout the internet usually used to create links between different pages, files or directories.
One of the questions though is why do we use them.
Take this blog’s URL for example https://webdev-bb.blogspot.com/ why do we use this.
Well firstly, this blog is made up of various files located in different locations. So in order to find those files we need some kind of map to them all. Most modern computers use what are known as IP addresses, a short string of numbers used as an identification for accessing the device given a known location.
Your home pc has its own IP address so why not use this?
Well we could use this but you would be broadcasting your computer to the internet and anyone who has your IP address could both send and receive files and data to your computer. This is why your home network has a local IP address for devices that are on the same network to ensure you can access your devices when needed, and a separate IP address that is publicly accessible that constantly changes to ensure your safety while online.
Publicly accessible or global IP addresses still have the security issues but with some form of encryption and some specific security features it is possible to minimise the risk of your computer being compromised.
For websites that must be publicly accessible to enable everyone to view your site, this trade off between security and access is very important and complicated. Therefore, the alternative is to use a URL in place of the constantly changing global IP address, which masks off the IP address to those who want to misuse the site. URLs are generated to identify the particular content on your website being accessed on the internet and can be used for pages, files, or folders. The URL typically uses the domain name (user friendly address of your website’s IP address) which is registered with your hosting provider (the company/person who owns the server that you run your site on).
When you are hosting the site yourself it is possible to create your own domain name and a URL for a particular resource but you need to have the domain name registered with the main domain the website is affiliated with (.ie, .co.uk, .com, etc.). I will be going through domains and subdomains in a later post but this process is important as it provides the main domain with your global IP address of the PC or server so their internal processes have the information needed to redirect the various people who want to view your site to the right location.
If I were to go back to the map analogy, the domain and URL are the map and key while the global IP address would be the exact location you are trying to reach.
——————————
Well that’s it for this post, I hope it provides some useful information to you.
While I try to be as accurate as possible, I may have made a mistake or misunderstood something myself, if so please feel free to correct me in the comments.
I will occasionally revisit these posts in cases where I find I have made a mistake, highlighting the error and writing a short explanation of the issue and any corrections.
I will be back in the future with the next post, but until then…
All the best
BB
Comments
Post a Comment