Jump to content
xisto Community
Sign in to follow this  
ComeToLife

Up One Directory In Url How do I...?

Recommended Posts

For some reason I thought it was possible to have a url in the form of "../file.html" Meaning if you were at the page "https://www.salesforce.com/products/platform/overview/ and there was a link in main.html that said "../file.html" it would take you to https://www.salesforce.com/products/platform/overview/ Anyone know the proper syntax for this, or do I just need to put the full URL in place? It's a whole lot easier if I don't have to put the whole URL in place...because it makes ftping and editing from other locations SOOOO much more convenient.

Share this post


Link to post
Share on other sites

You are correct. The "../" tells the path to go up one directory. There can be multiple occurences, too, like "../../" to go up two levels.
Do a Google on "relative links" because that is what they are. Also, search the forum here, because this has come up before.
Also, on Apache servers there are "Server Absolute Links", but they aren't recognized on all servers, so use them carefully.

Here is a link from our Xisto forums that might help.

Relative Links - URLs

Share this post


Link to post
Share on other sites

Yes, from what I know, the ../ is the correct way to put it. You just have to make sure that you do indeed have the file that you are calling in the folder one level up......I had no idea that all servers don't recognise relative links. Is this something that I should be worried about when making them, or is this 'apache' server not what we use. I'm all confused, but what else is new lol...

Share this post


Link to post
Share on other sites

Sorry for double posting but didn't read all of the original post properly the first time.

Anyone know the proper syntax for this, or do I just need to put the full URL in place?  It's a whole lot easier if I don't have to put the whole URL in place.

To go with what I posted above about absolute paths, you don't have to type the full URL, just do this: /stuff/file.html.

Share this post


Link to post
Share on other sites

Here is a sample file showing server absolute, relative, and absolute links.

Jim's sample of linkingl

Do a viiew source of test2-1 to see the worst case scenario. It can get ugly.

Hope this helps some one.

Edited by jlhaslip (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.