Solved

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

Posted on 2015-01-02
3
134 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
3 Comments
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 100 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 100 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 300 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
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.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

919 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now