URL

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.
  • Directories to a webpage on the site (/resources/blog/what-is-web-development/).

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn More on Codecademy