URL
Published Jun 25, 2022Updated Nov 28, 2022
Contribute to Docs
A Uniform Resource Locator (URL) refers to where a resource can be found. This includes locations for web pages and media such as images and videos. URLs use protocols to perform different tasks with these resources including:
- Web browsing with HTTP/HTTPS
- Transferring files with FTP/SFTP
- Sending emails with SMTP
Syntax
|----------------------------URL-------------------|
| |--------------------------URN------------|------|
scheme://domain:port/path/to/resource?query=params#fragment
|----------------------------URI--------------------------|
Since URLs and URNs are a subset of URIs, the syntax can be similar. However, URLs use a scheme that describes the protocol used to find the resource. Next, a domain and possible port number are used to describe the authority behind the resource.
Example
https://www.codecademy.com/resources/blog/what-is-web-development/
The example above uses the following:
- A protocol scheme (
http) to connect to the Internet - A subdomain (
www) for the world-wide web - A domain (
codecademy.com) to a website - A path (
/resources/blog/what-is-web-development/), which locates the specific resource
Note: URLs follow a standard format that always uses a forward slash (/) as the path separator regardless of the operating system.
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn General on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
- Includes 34 Courses
- With Professional Certification
- Beginner Friendly.115 hours