?
Solved

What does this mean, as far as a reference to a URL?

Posted on 2015-01-02
3
Medium Priority
?
146 Views
Last Modified: 2015-01-02
If I'm documenting a relative URL, in other words, I'm not documenting it as "http://www.whatevercom," then I'm going to use a combination of characters so my user will be routed correctly when the click on the link.

If the file is sitting in the current directory, then my relative URL would look like this:

"myfile.htm"

If it was sitting in a directory one level up from my user's current location, then that URL would look like this:

"../first_folder/myfile.htm"

And just to be clear, here's my hierarchy:

root
anotherfile.htm
     first_folder / myfile.htm
     second_folder - my user's current location
          second_subfolder

...and if my user wanted to access "anotherfilehtm" in the root directory, based on my architecture I've got above, then my URL would look like:

"../../anotherfile.htm"

Cake and ice cream, right? Basic stuff. But now I'm looking at another programmer's code and they their css file referenced like this:

<link rel="stylesheet" href="/css/AreaBasePage.css" typr="text/css" />

I'm stumped! I've never seen a file name prefaced with anything other than "../" or something similar. Where is my file located if it's referenced as "/myfile?"
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 400 total points
ID: 40527938
It is located in a subfolder where the HTML file is located.

So if the HTML file is located in root/first_folder, then it is in root/first_folder/css.
0
 
LVL 26

Assisted Solution

by:Shaun Kline
Shaun Kline earned 400 total points
ID: 40527940
When you start a URL reference with a slash (/), the URL is referenced to the root of your website. In your example, there is a CSS folder at the root with the .css file in it.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1200 total points
ID: 40527941
"/myfile"  - Root of the site
"myfile" - Relative to current page
"../myfile" - Up one directory from current page
"./myfile" - Relatieve to current page
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question