Deverill Posted November 7, 2003 Posted November 7, 2003 (edited) A forum reader asked me in email: Problem: I can't seem to find out how I need to change my paths in the html code. I believe I need to load everything to public and all pictures and animations to images folder. If that is true I'm not sure how to change the path in my code to reflect the images folder. Here's what I replied (slightly edited): The locations of various website files is entirely up to you except the entire site must live under the public_html folder. If you choose to use an images folder then you are free to do so... many web designers do that to keep their sites neat and tidy. Here's a simple example to do it this way: ><HTML> <HEAD> <TITLE> test page </TITLE> </HEAD> <BODY> Here's my picture of my dog Toto.<br> <img src="/images/toto.gif"> </BODY> </HTML> Assume this file above is called index.htm you put it under /public_html when you upload it and you put the toto.gif file under /public_html/images folder. When someone goes to your site they will see the sentence "Here's my picture of my dog Toto." and your little dog Toto's picture. If you wanted to dump all of the files into one folder (I'd recommend against it) you would replace the next-to-last line with: <img src="toto.gif"> The file path you put after src= would be in relation to the htm file being edited. I have a church site with many folders - one for ministries, one for images, one for mission trips, etc. In all of my sites I try to remain consistent. I have folders for images, styles which include CSS stylesheets, Templates which are where my Dreamweaver templates are, and major categories if the site is going to be very large. Hope this helps - if you have any questions just post to the forums in the appropriate category. Family members are standing by to answer your questions. Seriously, there are a lot of smart folks here and they love to help out! Edited November 7, 2003 by Deverill Quote
seaheather Posted November 20, 2003 Posted November 20, 2003 Hello, I am a new member of the family (as of today). I am attempting to prepare my website so it will be up and running when the transfer of my domain is complete. I have put my index file in the public_html folder, and my images in the images folder. When I look at the page, the images do not load. I edited the html so that the entire path is shown, starting with "http://", and then the page loads as intended. What am I doing wrong? I don't want to have to edit the path of all my pictures every time I work on my page offline and want to upload it again. Thanks for any help you can offer! Karen Quote
TCH-Andy Posted November 20, 2003 Posted November 20, 2003 Hi Karen, Welcome to the family Instead of using >http://domain.com/images/picture.jpg use >/images/picture.jpg This is assuming that your file is in the public_html firectory and that your images are in the public_html/images/ directory Quote
seaheather Posted November 21, 2003 Posted November 21, 2003 Hi Andy, Thanks, but it doesn't work for me. Whenever I try to just use /images as the address, the pictures do not show up. I have to use the whole path. My images are in the images folder, and my index file is in the public_html folder, so it OUGHT to work, but it simply does not. I had the same problem with my last web host, so it isn't a new problem for me. I just can't see what I'm doing wrong! Karen Quote
TCH-Don Posted November 21, 2003 Posted November 21, 2003 Karen, have you tried images/imagename.jpg as a relative path it will look for the image folder below the current place the site is located. And if you have an image folder below your site on your computer with the same images, it will also work. And Welcome to the family Quote
seaheather Posted November 21, 2003 Posted November 21, 2003 I tried that, Don, and it didn't work. BUT this morning I tried eliminating that first front slash, and lo and behold it now works! So the answer was to not use the front slash before the name of the images folder. At least that seems to be the case. Until the gremlins get in there and mouse me up again, I'm a happy camper! I've come to realize that the more I think I know about computers, the less I really know. Or is it that the computer simply wants to put me in my place? Thanks to you and to Andy for the replies. I was feeling extremely frustrated, and having people give suggestions was a big help. I wonder why that front slash didn't work for me, when it seems to be the way most people are doing it? As long as I've found a solution, I guess I shouldn't question! Thanks again to you both! Karen Quote
agsilva Posted March 2, 2004 Posted March 2, 2004 Hi. I am having the same problem. I have tried using slash, no slash, etc. but the image refuses to load. It is a png. The alt text does show up though. EDIT: Got it. I has spelled source= out completely. Been awhile. Should be src= Quote
BigDaddyJinx Posted June 4, 2004 Posted June 4, 2004 Ok so I'm a newbie to TCH but bear with me. I have 2 other sites hosted elsewhere through my ISP and I had no issue whatsoever setting them up and having them work. I've never had a "paid" host before, and some of the gear is strange, but not strange enough to prevent me from seeing what I wanna see. Therein lies the problem. I have a domain and all but it'll take 72 hrs approx. to have it cycle through the world registers, so I'm using the IP for now. I've uploaded all my files from the sites to this host and placed them in the appropriate folders (or so I believe), but when I goto http://IPaddress/index.html or http://IPaddress/www/index.html all I get is a generic error that says I have no site set up at that address! What gives?! Mad!!! All my html files are in the public_html folder, images are in the images folder, but no go. I'm stressed. Am I doing this wrong? Did I miss a step? HELP. Quote
TCH-Don Posted June 4, 2004 Posted June 4, 2004 (edited) First Welcome to the family in your welcome e-mail you should see ========================================== Access your Site ========================================== To access your site before the domain name completes propagationyou can go to the URL below to view your site. http://IP/~username/ Edited June 4, 2004 by TCH-Don Quote
sheryltoo Posted November 15, 2004 Posted November 15, 2004 Hi, I am new too and getting so frustrated. I've been trying to set up my index.html page for a couple days now using a double background and placing a welcome banner on my site. I thought I created a background folder to hold my images but I think I created a background file instead since it showed up looking like a file and not a folder. Thinking this was a folder, I uploaded my graphics to it, but now that I'm learning a little more about what I'm doing, I think all I did was upload the graphics to my public_html folder since everything was listed below all my folders including that backgrounds file. In any event, after doing all that but basically doing it wrong, I was able to see my graphics if I used this for the path to my graphics: http:www.domainname.com/graphic.jpg Now that I realized I put my graphics in the wrong place, I decided to set up a folder under public_html, called backgrounds and moved all my graphics to it, but now my graphics won't show up. First of all, just to be sure I set up my folder correctly, let me explain what I did. I opened my public_html folder and said I wanted to create a new folder. I named it Backgrounds. When my pictures wouldn't show up, I tried naming it Backgrounds_html. Which is correct? Once I had my background folder created, I moved all my graphics to it but didn't change the path on my index.html page thinking they should still show up but they didn't. I then tried to edit the path to just backgrounds/graphic.jpg but that didn't work, so I put my domain name first, then the background folder and still no graphics will show up. I must be doing something wrong but I don't know what. I guess I first need to be sure I created my folder correctly. Sheryl Quote
btrfld Posted November 15, 2004 Posted November 15, 2004 Hi Sheryl. Based upon your explanations, I have a couple of thoughts. The folder for your images can be called anything, so Backgrounds or Backgrounds_html should work equally well. I suspect that your trouble is that Linux is case-sensitive. So if your folder is named Backgrounds, the references should be Backgrounds/graphic.jpg rather than backgrounds/graphic.jpg. Now, again about the reference in the code: using Backgrounds/graphic.jpg produces a relative reference, meaning that the browser will look for the Backgrounds folder in the folder containing the html page itself. To reference the Backgrounds folder from anywhere, and allow portability of your html, you can use /Backgrounds/graphic.jpg, which looks for the Backgrounds folder directly under public_html, no matter where the current page lives. Hope that helps a bit. Quote
sheryltoo Posted November 15, 2004 Posted November 15, 2004 Thanks for the reply. I never thought about the path being case sensitive. Gosh, there's so many things to think about. I renamed my folder using lower case letters cause I thought that would be easier in the long run and now if I go to my page my backgrounds are showing up. However, if I click show file under File Manager the backgrounds aren't there. They showed up before I moved those background tiles. I haven't moved my Welcome sign and that still shows up so I don't understand why the background tiles don't show up, now that I corrected my folder name. I have another problem. I uploaded a zip file to a new folder called zip under public_html and tried to put a link to this file on my index page but the link doesn't work. This is how I tried to link it..... Click <a href="http://www.domainname.com/zip/zipfile.zip/"> here</a> to save the zip file to your computer. Is that the correct way to link a file? If so, should it work or does the server not allowing us to link zip files? Sheryl Quote
TCH-Bruce Posted November 15, 2004 Posted November 15, 2004 here to save the zip file to your computer. That should be: Remove the trailing "/" Quote
TCH-Don Posted November 15, 2004 Posted November 15, 2004 Sheryl, I would recommend using an FTP program to manage your files as file manager is not the easiest way. With an ftp program you will will have two windows side by side one showing a folder on your computer and the other showing a folder on your site. You can select and drag from computer to site, or from site to computer. Some will even let you view the file on your site. You can select a site folder or file and right click to rename, delete or change its attributes (read, write.....) called permissions. I use CoreFTP Lite and am very happy with it. Quote
sheryltoo Posted November 15, 2004 Posted November 15, 2004 Thanks for the suggestion Don and thanks for telling me I needed to get rid of that "/". I did that and now I get the option to save my zip file. I didn't realize linking to a file and linking to another site would be different since I also decided to try linking to another web address and that worked using the "/" at the end of the web address. Another problem solved. Sheryl Quote
TCH-Don Posted November 15, 2004 Posted November 15, 2004 The / at the end of a link tells the browser to look for a folder and display the default file inside. so www.domain.ext/ will display the default page in the main public folder www.domain.ext/name/ is a subfolder www.domain.ext/name.ext is a file Quote
sheryltoo Posted November 16, 2004 Posted November 16, 2004 Thanks for that explanation Don. Sheryl Quote
dooodlebugg Posted January 17, 2005 Posted January 17, 2005 Hi, I have a question. I uploaded an index.html to my public_html folder, but when I go to my website, that html doesn't automatically come up. It still goes to the page that says "Index of/" and then lists the folders/files. How do I make it so that when I go to my website, www.mywebsitename.com, the index.html file comes up? Thanks! Valerie Quote
TCH-Rick Posted January 17, 2005 Posted January 17, 2005 If you have a file called index.html in the public_html directory it should come up as the default page. Be sure that the filename is lowercase only. Without a domain name I am afraid we cannot be sure what might be happening. Quote
TCH-Bruce Posted January 17, 2005 Posted January 17, 2005 Welcome to the family and forums, Valerie! Quote
dooodlebugg Posted January 18, 2005 Posted January 18, 2005 Hello again, Thank you very much for the kind welcome and fast response. The tech support on this site is the best I've seen anywhere. You were right, I had Index.html capitalized. I changed that and it fixed the problem. Thank you again! I'm glad to be part of the family. Valerie Quote
TCH-Don Posted January 18, 2005 Posted January 18, 2005 Welcome to the Family Valerie and your new home! We really are like family here. So if you need anything, just ask your new family! We love to help Quote
AmandaM Posted February 5, 2005 Posted February 5, 2005 Hi, I'm having the same problem as Valerie....Except my index.html is already lowercase but when I go to www.**** all that shows is the HTML code? I uploaded it under public_html I'm sure I'll get the hang of this someday but for the time being it's making my brain hurt Amanda Quote
TCH-Rob Posted February 5, 2005 Posted February 5, 2005 Amanda, PM me your domain name and I will take a look and see what may be causing the problem. Quote
mysticnights Posted January 21, 2007 Posted January 21, 2007 I have uploaded everything with my FTP ..... but I can't see anything no matter which route I take...I either get the page can not be displayed .... or the other route .... Index of ... So I am wondering if I put my index files in the wrong place (my index files contain everything I need for my main pages) .....I saved my html as index.html links.html etc.......all those pages I uploaded separately and then I uploaded the full index folder with all the files in it .........now I didn't put that into another folder....should I have????? Quote
mysticnights Posted January 21, 2007 Posted January 21, 2007 Okies...never mind that problem....I moved every folder and all my html pages to the public.html folder......I can see something ... not one image .. just black and grey.....sooooooooooo .... do I have to change all my html to view the images? right now I have background="indexfiles/indexheader1.jpg" so now I am not really sure what I have done wrong... Quote
TCH-Bruce Posted January 21, 2007 Posted January 21, 2007 You need a file called index.htm, index.html or index.php for it to load a page by default when you go to your domain link. And Case matters, these are Linux servers and not Windows. Quote
mysticnights Posted January 21, 2007 Posted January 21, 2007 My main page is index.html I had all my files in a folder called index and I changed that folder to indexfiles.... my index.html page is uploaded separately from that folder.....all my images are directed to that folder.... as in "indexfiles/indexheader1.jpg" everything is lower case ...... Quote
mysticnights Posted January 21, 2007 Posted January 21, 2007 I put my index.html in the public.html folder along with every html page and all the images folders ...I didn't have them in the public.html folder so I got nothing....now does it matter that I can't access my domain still and using that other way...cause I know none of my links will work... Quote
TCH-Bruce Posted January 21, 2007 Posted January 21, 2007 I've sent you a PM please answer it and I will take a look. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.