Solved

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

Posted on 2015-01-02
3
135 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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