Monday, 19 February 2018

linking to root of website, not root of drive

I have tidied up one of my websites to make better use of CSS, and now
intend to add some new pages to it. Of course I want to keep it
Netsurf-friendly.

The <head> section of each article includes the usual link to my
stylesheet, which (in Linux filepath syntax) might be

2018.css or
../2018.css or
../../2018.css etc

depending how many branches back it roosts on the directory tree.

Advice from Linuxland tells me that simply prefixing a "/" with no
dots before it makes the link "absolute" (to the root of the website)
rather than relative to the page where we are when writing the link.
IT would be quite handy&welcome to use this trick rather than having
to adjust the links for stylesheet, page background and top-of-page
graphic if I relocate a page in the directory structure. This indeed
works when viewing my page online.

However, when developing the page in the local copy of my site rather
than online, the "absolute" version of the link looks for the *root
directory of my own RiscOS drive* rather than the root of the website.
If I make a copy of the stylesheet as $.2018/css Netsurf is happy.

Is there a way around this? Is there some setting I would need to
make in Netsurf to define what I mean by "/" as root? (Presumably
there is such a setting in my ISP's software, for I am not being taken
to the root of their drive!)

Excuse me if this is a dumb question, but I haven't been here before.

http://glastonburyconservation.org.uk if anybody wants to have a look.

--
Jim Nagel www.archivemag.co.uk
|| See you at the show? www.riscos-swshow.co.uk Feb 24

No comments:

Post a Comment