Quiz
- Could you explain how to read relative URLS/ go over the example of the tree?
Sure. Let's look at it together: relationship rules
- It says "../otters/barry.html starts from the stones.html file", it also could start from beatles.html?
Yes, because those files are siblings.
- When we say A is ""above"" B, does it mean that A is the parent folder of B? Can you explain this relationship?
robin.html starting from the barry.html file. beatles.html starting from the stones.html file. ../bands/stones.html starting from the robin.html file ../otters/barry.html starting from the stones.html file
why are they relative urls?Yes, A above B means it's a parent or ancestor.
- Can you go more in depth on the ".."? I thought the diagram (in the reading) was helpful but want to know if you could explain a little more on the sibling/parent dynamic so I can be sure I'm understanding this correctly.
Glad to. The
..
means to go up one level, say from being a file in thebands
folder (beatles or stones) to being in thefavorites
folder. - Relationship Rules: especially, could you please draw a directory tree structure to show about URLs like ../../africa/botswana.html? Which folder is each "".."" referring to? Thank you!
I was asking you to imagine one, so let's imagine some sibling to
africa
, sayasia
, that has a subfolder, saysoutheast
, with a filevietnam.html
. So to get fromvietnam.html
tobotswana.html
we need to do../../africa/botswana.html
- Still very confused about why rel: F2/B doesn't work when A gets moved into a new folder called old.
Great question. Because the relative URL starts with
F2
which means the F2 folder that is a sibling of this file. But there isn't such anF2
. - Any difference between http and https? When a path or domain name is changed can that affect a relative URL or would it try and search for the filename regardless? Can we access webpages by using relative URLS? Some websites never show the whole domain, path name when you click on the name , they would display just ""xyz.com"" in the URL tab on a search engine, how does that work, is it an absolute or relative URL in this case?
HTTPS is secure (via encryption); HTTP is not. Use HTTPS.
Relative URLs are always for two things on the same server, so necessarily the domain name is the same.
You could use a relative URL in a browser, but you'd have to edit the URL, which most people don't do. But you can.
Yeah, browsers can be annoying about hiding the URL. But that's because most ordinary people don't care. We're not ordinary any more. But the URL is there and the browser knows it; the browser just hides the complete URL from us.
- A lot of URLs seem to be strings of random characters and numbers that aren't as clearly labelled as our examples. Why is this?
More and more web pages are created dynamically, without humans naming things, so computers generate random strings for uniqueness. Look at Google docs. Sure, you have a name for the file, but Google can't be sure that you will name it uniquely, so it mostly ignores the name you give it, and it uses the unique ID.
But names and URLs can be friendly for people.
- I'm still confused about the different, and would like to see more examples.
I hope it'll become more clear as you practice. If not, please talk to me!
- N/A -- the GPS example at the end helped things make sense really well!
I'm glad!