URL part: the protocol

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

URL part: the protocol

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does the protocol at the start of a URL tell the browser?
A Which colour theme to use for the page
B Which set of rules to use to fetch the page
2. In https://www.example.com/index.html, which part is the protocol?
A https
B www.example.com
3. Which characters separate the protocol from the rest of the URL?
A ://
B //:
4. Which protocol in a URL means the page is sent without encryption?
A https://
B http://
5. Which URL starts with the secure protocol?
A https://www.bank.com
B http://www.bank.com

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1http:// Ahttp://
2https:// BThe protocol is missing from the start of the URL, so the browser is not told which set of rules to use. It needs http:// or https:// at the start.
3The protocol at the start of a URL tells the browser which set of rules to use to fetch the page CProtocol that tells the browser to fetch the page using the secure, encrypted version of HTTP
4The :// characters separate the protocol from the rest of the URL DProtocol that tells the browser to fetch the page using HyperText Transfer Protocol, with no encryption
5https:/www.example.com Ehttps://www.example.com/index.html
6www.example.com/home.html FThe separator is incomplete: it has only one forward slash. It should be :// so the protocol is clearly separated from the domain name.

Definitions

https://

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
_____://bank.example.com/login
2.
http___www.example.com
3.
____://www.example.com/index.html
4.
http_://shop.example.com/cart
5.
<a href="____://www.example.com">Visit</a>

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A url = "https://bank.com/pay"
B protocol = "http"
C secure = true
Question 2
A url = "http://school.com"
B protocol = "http"
C secure = true
Question 3
A url = "https//shop.com/cart"
B protocol = "https"
C separator = "://"
Question 4
A IF protocol = "https" THEN
B OUTPUT "Encrypted"
C ELSE OUTPUT "Encrypted"
D ENDIF
Question 5
A url = "http://news.com"
B parts = url.split("//:")
C print(parts[0])

Answer Key

URL part: the protocol
Section A: Quick Questions
Q1
B — Which set of rules to use to fetch the page
Q2
A — https
Q3
A — ://
Q4
B — http://
Q5
A — https://www.bank.com
Section B: Match the Pairs
Q1
http:// → Protocol that tells the browser to fetch the page using HyperText Transfer Protocol, with no encryption
Q2
https:// → Protocol that tells the browser to fetch the page using the secure, encrypted version of HTTP
Q3
The protocol at the start of a URL tells the browser which set of rules to use to fetch the page → https://www.example.com/index.html
Q4
The :// characters separate the protocol from the rest of the URL → http://
Q5
https:/www.example.com → The separator is incomplete: it has only one forward slash. It should be :// so the protocol is clearly separated from the domain name.
Q6
www.example.com/home.html → The protocol is missing from the start of the URL, so the browser is not told which set of rules to use. It needs http:// or https:// at the start.
Section C: Definitions
Q1
https:// — The protocol at the start of a URL. It tells the browser which set of rules to use to fetch the page: http:// is unencrypted, https:// is secure. The :// separates it from the rest.
Section D: Fill in the Blanks
Q1
https://bank.example.com/login
Q2
http://www.example.com
Q3
http://www.example.com/index.html
Q4
https://shop.example.com/cart
Q5
<a href="http://www.example.com">Visit</a>
Section E: Spot the Error
Q1
B — The URL starts with https://, so the protocol is "https", not "http". The protocol is the part before ://.
Q2
C — http:// is the unencrypted protocol, so the page is not secure. Only https:// is secure, so this should be secure = false.
Q3
A — The colon is missing. The protocol must be followed by the :// separator, so it should be https://shop.com/cart.
Q4
C — If the protocol is not https, the data is not encrypted. The ELSE branch should output "Not encrypted".
Q5
B — The separator is :// not //:. Splitting on "//:" will not find it, so it should be url.split("://").