Page 1 of 1

Confused newbie - path directory not linking index to everything else

Posted: 2018-03-02 23:38
by beellllaa
Hi everyone !

I'm new to filezilla and hosting. I have my index.html in my www folder and I put like everything else in a folder called "SITE" that has many other folders for whatever. I can't seem to get the path right in my index to relink back into this site folder.

As a simple(?) example,
I have an icon for the tab that I want and it's an .svg file. The path on my local is this "Desktop/SITE/assets/img/icon.svg" So since my index is in the SITE folder my code looks like this:
<link rel="icon" type="image/svg+xml" href="assets/img/icon.svg">

When I take my index out of the SITE folder, and I put it in the www, obviously it loses the connection. So I've tried the following options:
<link rel="icon" type="image/svg+xml" href="../assets/img/icon.svg">
<link rel="icon" type="image/svg+xml" href="www/SITE/assets/img/icon.svg">
<link rel="icon" type="image/svg+xml" href="../SITE/assets/img/icon.svg">

Please help with my potentially dumb question ):

How can I reconnect this SITE folder back to my index if my index can't be inside the SITE folder?

Thank you in advance !!

Re: Confused newbie - path directory not linking index to everything else

Posted: 2018-03-03 02:27
by boco
Please don't cross-post (other post deleted). Also, moved, since it hasn't anything to do with FTP.

If, on your webserver, the www directory is the so-called web root, then absolutely nothing outside that directory is served by the HTTP server. In other words: Everything you want to be part of the website (visible to browsers) must be inside the web root. So, move everything website-related into www and change your links according to that situation.

Re: Confused newbie - path directory not linking index to everything else

Posted: 2018-03-03 10:08
by beellllaa
Hi boco -

Ah I'm sorry about that! I was a bit frantic and frustrated last night with this and I just needed an answer. I had assumed FTP was anything related to the filezilla workspace so I apologise on behalf of my neglegence.

In regards to your reply for my issue -
Everything for my site is in the www directory. Within that directory, I have index.html, style.css, and a folder that has everything else, which is called SITE.
I found that even when I put the style.css into my site folder, the path is lost from the index - and I did a lot of troubleshooting with different paths to try to fix this.
So I took the style out of that folder, and put it with the index.

However, everything that is in my site folder (which is in the www directory) is not being found.
I've tried multiple pathways, as mentioned in my main post, to get the index(in the www directory) linking back up to find that site folder(also in the www directory).

As of right now, my website is only displaying the index and the style page. But my site should be a fully functioning portfolio site.

I hope I've explain this a little better!

Re: Confused newbie - path directory not linking index to everything else

Posted: 2018-03-03 21:56
by boco
Check how the directories are named EXACTLY. Contrary to e. g. Windows, everything path-related on web servers (that run on *NIX OS with POSIX file systems) is case sensitive! So, if the directory is named SITE, use exactly that capitalization in paths, or it will not work.

Example:

Code: Select all

<link rel="icon" type="image/svg+xml" href="SITE/assets/img/icon.svg">
www is web root, so it MUST NOT be specified (as for the HTTP server, www does only exist as / (root). The root slash should be omitted to keep the links relative (the complete structure can be moved anywhere without having to fix links). Files in the same directory are linked by only the file name.

SITE MUST BE specified as-is, that means, all-caps if that's the directory name.

Same for the other directories AND the file names. Icon.svg is a different file as icon.svg or ICON.SVG.


For *NIX-like web server, you also have to check permissions (if you get 403 or 404 errors although files are there).