Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 10:20:50 AM

Pages: [1]   Go Down
  Print  
Author Topic: absolute URLs  (Read 551 times)
rubix333
Intergalactic Cowboy
*****
Offline Offline

Posts: 61


WWW
« on: May 19, 2002, 07:22:00 AM »

if i've got a file in public_html/folder1/folder2/file.html, how do I make a URL that refers to an image in public_html/folder1/image.gif?
Logged
ShockQueen
Spaceship Navigator
*****
Offline Offline

Posts: 97


WWW
« Reply #1 on: May 19, 2002, 08:27:00 AM »

The link would be:

<img src="/folder1/image.gif">

Basically, you don't refer to the root directory, so if the image was in the root directory (public_html),then it would have been <img src="image.gif">, so you just go down from that point to where it is.

I hope that helps.

SQ  
Logged

I keep clicking my ruby slippers, but the teleportation crystal inside must be broken!
rubix333
Intergalactic Cowboy
*****
Offline Offline

Posts: 61


WWW
« Reply #2 on: May 19, 2002, 08:29:00 AM »

thanks!  
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #3 on: May 19, 2002, 02:48:00 PM »

Seems it would be "../image.file" if it's the same directory structure you indicated above.

That would be for relative.

But you can always be sure to get to it by using:
"/folder1/image.gif"
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
stephan
Guest
« Reply #4 on: May 19, 2002, 06:20:00 PM »

Yeah, "../" makes it go back on directory from the page you are on/

You can add two together to go back two directories like this: "../../"

For example,

Webpage address = /hello/pictures/s/w/g/sss.htm

Image address = /hello/pictures/

html from webpage = <img src="../../../../ etc...

(I think I counted them right...)
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #5 on: May 19, 2002, 09:55:00 PM »

But if you try to go one more slash, it won't happen unless you're using the file system.  That's why its nice we have public_html folders inside our user folders.  We can create a folder in our user folder next to the public_html folder and use it for flat files and such, and they're unnattainable through http, only through the file system.

WOOOOHOOOO
 
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
rubix333
Intergalactic Cowboy
*****
Offline Offline

Posts: 61


WWW
« Reply #6 on: May 22, 2002, 07:51:00 AM »

of course, now i see why that public_html's there!  useful.  thanks for the tips!
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: