Welcome to the Treehouse Community
Looking to learn something new?
Jarett sisk7,522 Points
I'm a little confused on why the "request.url" returns a "/". Where does this "/" come from? and why does it exist?
Just Curious. I'm not sure how it correlates with the browser URL.
Michael Hulet47,842 Points
A URL is meant to correlate to a specific file/directory on a server. In fact, if there's a plain, static site at https://hulet.tech (which there is), and I request https://hulet.tech/css/home.css, my browser will go to the root directory (
/) of the server located at https://hulet.tech, look in the
css directory inside the root directory (
/css), and look for a file called
home.css inside of that
css directory (
/css/home.css). Likewise, if I request https://hulet.tech/resume.pdf, my browser will go look in the root directory (
/) of the server located at https://hulet.tech, and it will grab a file named
resume.pdf, which is inside that root directory
This is all meant to illustrate that the first
/ is a very important part of the URL, and it represents the root directory of the site, which all of the site's on-server resources are located in, just as it would on a normal computer's filesystem