Struggling with path terminology

Just when I think I have figured things out I am still fuzzy. If I want to refer to the root of my site from any file do I use ./  or  /  or do I have to use an absolute path. I am confused about when to use ./ and when to use /.
MarleneAyersAsked:
Who is Participating?
 
Jason C. LevineConnect With a Mentor No oneCommented:
Thanks, angel.
0
 
ZylochCommented:
Hi MarleneAyers,

Unless I'm mistaken, ../ refers to the parent directory of the current one you are in. ./ refers to the current directory. And / refers to the root directory of your site.

Regards,
Ted
0
 
Jason C. LevineNo oneCommented:
Hi Marlene

../ == back up one level in the directory tree.  If you are at site root as defined by Apache, does nothing.

./ == Back up to site root (not used often, unless you are using templates, includes, etc)

/ == go forward to the next subdirectory (e.g. /images from root.  Not always necessary if you are just going one level down: <img src="images/spacer.gif">.  The leading slash is unecessary.
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
ZylochCommented:
Jason, I'm pretty sure you have ./ and / mixed up. http://en.wikipedia.org/wiki/Path_(computing)
0
 
Jason C. LevineNo oneCommented:
In terms of command line parameters, yes.  In Dreamweaver (document and site relative web paths), I think I'm right.
0
 
ZylochCommented:
O.o interesting. Is it really different in Dreamweaver? In code it's usually what I said, lol. Wow!
0
 
Jason C. LevineNo oneCommented:
I'm pretty sure / and ./ behave differently depending on how you're linking around.  I remember that when I first started, I got so frustrated with the concept that I basically gave up on site relative links and used SSI to write every path or just made things document relative or used full URLs.

If you can prove me wrong, I'd be happy to give up the points!
0
 
ZylochCommented:
Nah, nothing to do about the points, I've got enough anyways, lol. I'm just interested in this bit. I don't have Dreamweaver so I have no idea. But this is interesting :P
0
 
Jason C. LevineNo oneCommented:
It should not be limited to DW, unless DW does a little path conversion that I am unaware of...

Now I'm curious.  I'll have to test it.
0
 
MarleneAyersAuthor Commented:
Yikes! I thought I had this knowledge safely under my belt but you guys are really confusing me. PLEASE let me know the outcome of this cuz my head is sort of spinning.
0
 
Jason C. LevineNo oneCommented:
Marlene,

Zyloch is right and I'm not...  Please post a message in Community Support to get them to reopen the question for regrading and take away my answer as correct and give it to him.  Not for points, but so the PAQ is correct.

Mea culpa.  Sorry guys.
0
 
ZylochCommented:
No prob, it's an honest mistake, and heavens I've made a lot of those before.
0
 
Jason C. LevineNo oneCommented:
*Grumble*

I'm going to get a turbo-strength coffee and not post for the rest of the day.
0
 
Jason C. LevineNo oneCommented:
Hi mrichmon,

It's not really abandoned.  Marlene accepted my answer, but I was incorrect.  I asked CS to switch the points over to Zyloch and angelIII reopened the question for grading.  Zyloch's first post is completely correct and should be entered into the PAQ as such.
0
 
Jason C. LevineNo oneCommented:
Angel,

I'm not the asker...I can't close anything
0
 
Jason C. LevineNo oneCommented:
lol.

I guess it just isn't meant to be.  Sorry, Zyloch...I tried.
0
All Courses

From novice to tech pro — start learning today.