Jump to content

Files from another folder


Moonface

Recommended Posts

I'm trying to figure out how to link my site to one of my pages in another folder. Is it possible to even do that or do I have to have all my .html files in the same directory? I was trying to organize myself so it's not so cluttered. I figured I could do it similarly to loading an image from another folder, but apparently it doesn't work the same way. Thanks.

Link to comment
Share on other sites

you can link to any files in any folder anywhere on the server.heres an example - folder - public_htmlsub folders - images, folder1.in folder1, you have a web page, and you want to put an image from the image folder.you need to do this - <img src="../images/file.jpg">if you need to go back a folder, you put in "../" for each folder you go back. to go forward, you name the folders.such as <img src="images/small/file2.jpg">where the sub folder "small" is in the subfolder "images" and the page your putting it on is in the public_html folder.hope that helps :) (and works :) )

Link to comment
Share on other sites

This may look difficult for you, I'll make a summary of all things you can do:

file1.html
This opens a file in the current folder
folderA/file2.html
this will open folder A inside the current folder
/folderB/file3.html
this opens the rootfolder of the server, and opens folder B in it
../folderC/file4.html
this opens the parentfolder of the current folder, and opens folder C.So we have: [file] | [filepath] | /[filepath] | ../[filepath]---Do ask questions if you have :) Edited by Dan The Prof
Link to comment
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
×
×
  • Create New...