Chaz Boston Baden,
smofsweb@bostonbaden.com
Rev. 05-Apr-1997
Previous | Top |
Next
Naming Conventions
In the last sectiom, I mentioned the
relationship between files such as
http://lacon3.worldcon.org/www/Programming/filking.html and
http://lacon3.worldcon.org/filk.music
Things I Would Do Differently: I'd make the filenames match. If the web
page is 'filking.html', name the plain text file 'filking'.
I made all the web page filenames different - I didn't use
/www/Programming/index.html and /www/Masquerade/index.html, instead I used
/www/Programming/info-prog.html and /www/Masquerade/info-masq.html.
- "Something to be careful about on the web, if you have a
general directory (i.e. /www/Programming/) and it does NOT contain a file
'index.html' (or index.htm) within the directory, someone sending a
request to the directory (i.e. entering
http://lacon3.worldcon.org/www/Programming/) will receive a list of the
files within that directory on their browser. Thus they will have access
to all the files within that directory, sometimes you'd rather they didn't
(these could be out of date, or private files or ... .) I've found many
sites (including some that should really know better as
they are 'secure sites') which have this flaw. Creating new files with
special names is all well and good, but that 'index.html' file needs to be
there as well." (Joyce Scrivner)
I didn't keep "hidden" files in the same directory as "public" files, so
it wouldn't have been an issue, but just the same I took advantage of a
Unix feature called a 'symbolic link' - and I created a filename
'index.html' as an alias to the main page, such as 'info-prog.html', in
each directory. So if you go to
http://lacon3.worldcon.org/www/Programming/, you should get the
same
results as
http://lacon3.worldcon.org/www/Programming/info-prog.html.
If I had to do all this on a site that didn't allow symlinks, I'd probably
set up some kind of automatic clean-up script or batch file to run when
I'd finished editing the files that would copy the main entry page's
contents to "index.html", and I might even make the relationship between a
directory's name and its main entry page even closer. (Such as Programming
and Programming.html, to choose an extreme example.)
Or, I'd see if I could get the sysadmin to disable that feature on the
httpd. I've seen sites where you can't browse the directories by leaving
out the filename.
I tend to use capitalization to indicate directory names. Unix is
case-sensitive, and by doing so the directories sort separately from the
filenames when I do a directory listing. There are, of course, other ways
to handle this, including not worrying about these details.
I also tried to use web page filenames that were unique in the first 8
characters, because it let me download the files to my MS-DOS PC... and
with the filenames all being unique, if I had a file in the wrong
directory I could figure out where it belonged.
Previous | Top |
Next