Objective: Students will analyze and understand the different components of a URL through guided exercises.
https://thearthacking.io:8123/dir/test;id=89?name=omar&x=true
- Read through the example URL carefully.
- Complete the exercises below based on your understanding of the URL components.
Task: Identify and label each component of the URL. Use the table below to fill in your answers.
| Component | Your Answer |
|---|---|
| Scheme | |
| Host | |
| Path | |
| Path-segment-parameters | |
| Port | |
| Query-string |
Task: For each component you identified in Exercise 1, write a short explanation. Use the questions below to guide your responses.
- Scheme: What does it indicate about the type of connection?
- Host: Why is it important?
- Path: What does it specify?
- Path-segment-parameters: What is their purpose? Provide an example.
- Port: What does it signify, and why might it be non-standard?
- Query-string: How is it structured, and what is its purpose?
Write your answers here:
Task: Create your own URL using the specifications below. Fill in the template provided.
- Use the HTTPS scheme.
- Choose a unique domain name for your host (e.g.,
mywebsite.com). - Specify a port number (you can choose a standard port like
443or a non-standard port like3000). - Define a path (e.g.,
/products/item). - Include a path-segment-parameter with an identifier (e.g.,
;id=42). - Add at least two key-value pairs to the query-string (e.g.,
?category=books&sort=asc).
Your URL:
https://_________________:______/______________;id=____?______________&_______________
Task: In small groups, discuss the following questions. Assign one student to take notes, and prepare to share your thoughts with the class.
- How does URL structure affect search engine optimization (SEO)?
- What security issues can arise from poorly structured URLs?
- How can developers use the query-string to improve user experience?
Group Notes:
-
SEO Discussion:
-
Security Issues:
-
User Experience Improvements:
Once you have completed all the exercises, review your answers with your classmates and discuss your URL examples. This practice will help you gain a solid understanding of how URLs work and why they are important in web development and navigation.