What is the best way to link your website to images and files via ftp?
Is it better to do:
http://www.yourwebsite.com/images/image.jpg
or
/images/image.jpg
I am trying to find out the best way to link and lay out my website via ftp. I want to organize it the right way from the begining. Any tips would be great.
FTP has nothing to do with whether you use relative or full paths for your files. Most use relative as that is the way it is set up locally while you design and check your site in the various browsers before uploading them to your site via FTP. FTP just moves files back and forth. Has a few additional features like allow you to CHMOD your files in the Remote Panel quickly and more.
All you need be concerned about is maintaining the same working relationship you had locally after you upload your folders/files.
Ron



The answer depends on how you are coding your site.
If you are making a content mangement system i surgest using a full url.
(full url = http://www.yoursite.com)
otherwize just use /path/to/file/. But i surgest also to use a full url address as this will eliminate chances of errors such as file not found if you specify a wrong directory as it can get complicated when moving round directories such as:
/path/
../path
../../../path/path
etc
so its up to you but i recomend using a http/full url address.
hope this helps!
-Phil
References :
I’d do the opposite, that is, use relative paths and not absolute ones and make use of the <base> tag. It’ll be easier to maintain since, in case, you have to change hosts or whatever, you only need to change the value of the <base> tag once.
http://www.w3schools.com/tags/tag_base.asp
References :
FTP has nothing to do with whether you use relative or full paths for your files. Most use relative as that is the way it is set up locally while you design and check your site in the various browsers before uploading them to your site via FTP. FTP just moves files back and forth. Has a few additional features like allow you to CHMOD your files in the Remote Panel quickly and more.
All you need be concerned about is maintaining the same working relationship you had locally after you upload your folders/files.
Ron
References :