View Full Version : Go Back
TimFA
04-26-2007, 07:13 PM
I remember there is a command for file paths in browsers to make it go back a directory then forward. But I can't remember what it is.
Example:
KEY:
>> = Directory; If "--" before it, its a directory inside the directory above.
> = Page; If "--" before it, its a page inside the directory above.
>> Images
> Page 1, Image Path: image/image1.gif - OK
>> Programs
--> Page 1, Image Path: (something like) \\image/image1.gif - UNKNOWN
I hope I made it clear enough.
Thanks,
Tim
djr33
04-26-2007, 07:19 PM
I'm not quite sure about your question, but here is an overview of how paths work:
file.ext is a file existing in the current directory (same as the webpage)
dir/file.ext is a file in the directory 'dir' within your current directory
./file.ext is the same as 'file.ext', since ./ means current directory
/file.ext is the root, so yoursite.com/file.ext, no matter from where you link to it
../file.ext is in the folder above the current directory.
I think you want the last one.
For example if you have:
mysite.com/content/pages/examples
And you are in the examples directory,
a link "../../index.htm" would be the index page of the 'content' directory.
I hope this helps.
Remember, any combination of these is possible, and it's all relative. Once a command is made, it starts from there.
.././files/../../test
Means: up one, same directory, into "files", up one, up one, into "test".
Obviously that's more than you'd ever want to use, but it's worth seeing a visual.
TimFA
04-26-2007, 07:20 PM
Thank you! Thats EXACTLY what I wanted.
boogyman
04-26-2007, 07:27 PM
depending on how "far back" what you are looking for is, it is also possible to start the the very beginning and then map your site from there....
take for example I am at the url
dividinglimits.com/code/html/templates/home.html and on that page I need to get an image that is in my "images" folder that is on
dividinglimits.com/images
there are a couple ways of doing that, you could use a relative path
<img src="../../../top_bg.gif" alt="top background" />
or i could use a path from "home"
<img src="/images/top_bg.gif" alt="top background" />
now those would both point to the same image at the same place on the server, but they are 2 entirely different methods of getting there.
One is not necessarily better then the other, as they both have pro's n con's; they're just differnet ways, and which ya use it up to you
TimFA
04-27-2007, 03:16 AM
Hmm... Well, for now I'm gonna stick with the ".." method. My sites done (designed, has content, etc.) I just completely forgot how to do that.
djr33
04-27-2007, 05:54 AM
And don't forget you can always just use an absolute URL if needed.
("http://......file.ext")
The above URLs are called "relative".
mburt
04-27-2007, 10:05 AM
I believe when you use absolute url's you have to reload them into your cache if they were loaded via relative previously, so if you use relative, stick with relative, and vice-versa.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.