delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

Using the same link from anywhere in the site (say on a menu that appears on every page) is really handy, but I was just wondering what the specific rules are in relation to this kind of usage, as I'm new to this and am trying to be careful not to fall into an HTML crevasse!
Can anyone can cite some official guidelines for this href="/folder/" usage?
Thanks for any suggestions.


I'm exploring the formalities of relative links to folders.
In particular, I've noticed that, whereas a link like href="folder/page.html" must vary depending on where the referring page is located in the site (eg, another referring page might have href="../../folder/page.html"), a link like href="/folder/" can remain the same no matter what page it appears in, and will always land you on the index page in that folder.
Using the same link from anywhere in the site (say on a menu that appears on every page) is really handy, but I was just wondering what the specific rules are in relation to this kind of usage, as I'm new to this and am trying to be careful not to fall into an HTML crevasse!
Can anyone can cite some official guidelines for this href="/folder/" usage?
Thanks for any suggestions.

TOP

OK, thanks for that. So why does "/folder/" lead to the same folder no matter how deep into the site you put it?
If you look at the Happy Cog  site, for example, their menu is repeated on every page, folders withinin folders, but still the links are always just "/design/" etc.

TOP

Because / is always the doc root.  If your doc root is /var/www on the server, then / is always based on /var/www, and /folder/ refers to [/var/www]/folder/.  In the OS, / is the root directory, so /var/ is a sub-directory of root, and www is a sub-directory of /var.  The server treats the doc root like the OS treats the actual root.  / is the [doc]root, and everything is descended from [doc]root.
cheers,
gary

TOP

@Kravvitz and kk5st: thanks both very much. I get the idea now!



Using the same link from anywhere in the site (say on a menu that appears on every page) is really handy, but I was just wondering what the specific rules are in relation to this kind of usage, as I'm new to this and am trying to be careful not to fall into an HTML crevasse!
Can anyone can cite some official guidelines for this href="/folder/" usage?
Thanks for any suggestions.

TOP

Back Forum