PDA

View Full Version : Paths and FTP


whitney
5-1-02, 12:45 PM
I am dividing my site up into separate categories and keeping each page in separate folders using Ws_FTP Pro.
I've been trying to link to a stylesheet in a separate folder from the one that the page is in and cannot get it to work. My styles folder is under htdocs, so do I need to include that in my path like this:
href="htdocs/styles/whatever.css", which is not working
I also tried:
href="www/t/htdocs/styles/whatever.css" and could not get it to work
This is also a problem with my images, which are in a separate folder under htdocs as well.
Any guidance would be appreciated.

Ddr
5-1-02, 12:54 PM
when using <a href> you need a url. you can always play it safe and use the full url:

http://www.yoursite.com/styles/whatever.css

The same will hold true for your images:

http://www.yoursite.com/images/mysmile.jpg

but you shouldn't include htdocs in a URL. That would be used in the case of a path being called by a script. In a path, if a directory is located inside htdocs, then you would put htdocs in the path statement.

Hope this helps.


Dale

(jj)
5-1-02, 01:29 PM
If you wish to do it without a full url (using the http://etc) then you ignore the htdocs folder... that is a given.

so to use your example, it would look like this

<a href="/styles/whatever.css">

in the same manner, if you want to point to your main (index.xxx) file, all you would need is <a href="/"> to get back to your main index page.

Just my "For What It's Worth"

Ddr
5-1-02, 01:32 PM
I always think your "What it's worth" is pretty worthwhile *S*

Dale

mjenove
5-1-02, 01:43 PM
Originally posted by whitney

href="htdocs/styles/whatever.css", which is not working
I also tried:
href="www/t/htdocs/styles/whatever.css" and could not get it to work


This is where we get into "relative root directories". According to Apache's View Of the World, everything starts in your htdocs/ directory, and there is nothing before it.

So, when specifing absolute paths in your HTML documents:
"/" alone means <your login>/htdocs/
"/styles/whatever.css" means <your login>/htdocs/styles/whatever.css
"styles/whatever.css" equates to <the location of the file making the link>/styles/whatever.css, and finally
"htdocs/styles/whatever.css" equates to <the location of the file making the link>/htdocs/styles/whatever.css

If this is still a little confussing, feel free to PM me and I'll work on my examples a bit more.