Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

7 May, 2024: fms is rebuilding. Don't expect much in that section for quite a few days, maybe longer.


devel / comp.infosystems.www.authoring.html / Re: where to store web files in a dir tree

SubjectAuthor
* Re: where to store web files in a dir treeArno Welzel
`- Re: where to store web files in a dir treeHelmut Richter

1
Re: where to store web files in a dir tree

<k1of2cFdt4kU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=403&group=comp.infosystems.www.authoring.html#403

  copy link   Newsgroups: comp.infosystems.www.authoring.html
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.infosystems.www.authoring.html
Subject: Re: where to store web files in a dir tree
Date: Thu, 5 Jan 2023 18:18:04 +0100
Lines: 22
Message-ID: <k1of2cFdt4kU1@mid.individual.net>
References: <560a6cb-c8bc-94e1-5435-c049cfd02842@email.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net FLdx++o5cOyf2hhPnntuvwUYY5VFUePIzWT5mswAJWLXtVUmAS
Cancel-Lock: sha1:phfLVpBzqwvpP1rn1paIXKxHsPw=
Content-Language: de-DE
In-Reply-To: <560a6cb-c8bc-94e1-5435-c049cfd02842@email.de>
 by: Arno Welzel - Thu, 5 Jan 2023 17:18 UTC

Helmut Richter, 2023-01-02 15:35:

[...]
> Now I have two ways to store web contents in the file system:
>
> classical: the URL <domain>/a/b/c is served from file <doc-root>/a/b/c/index.ext
> which a suitable file extension (as a means to determine the content type),
> typically .html
>
> abbreviated: the URL <domain>/a/b/c is served from file <doc-root>/a/b/c.ext
> provided that there is no directory /a/b/c
[...]
> Are there any other reasons to prefer one of the methods over the other?

I would stick with <doc-root>/a/b/c/index.ext and not allow the
alternative <doc-root>/a/b/c.ext for the same URL to avoid confusion
what <doc-root>/a/b/c means in your filesystem.

--
Arno Welzel
https://arnowelzel.de

Re: where to store web files in a dir tree

<b984d691-4e89-ed9c-7ced-a6db5d4891dd@email.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=404&group=comp.infosystems.www.authoring.html#404

  copy link   Newsgroups: comp.infosystems.www.authoring.html
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: hr.usenet@email.de (Helmut Richter)
Newsgroups: comp.infosystems.www.authoring.html
Subject: Re: where to store web files in a dir tree
Date: Sat, 7 Jan 2023 17:23:23 +0100
Lines: 49
Message-ID: <b984d691-4e89-ed9c-7ced-a6db5d4891dd@email.de>
References: <560a6cb-c8bc-94e1-5435-c049cfd02842@email.de> <k1of2cFdt4kU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-Trace: individual.net NLktXMU8iutoxwwqHehgjwVWj+lCehKhKjNcNvpiOKMA3yQrPx
X-Orig-Path: kiboko2!hr.usenet
Cancel-Lock: sha1:PMMwQwsN71yL/CZfQJOaP7d6S5A=
In-Reply-To: <k1of2cFdt4kU1@mid.individual.net>
Content-ID: <ccbc3312-1485-44b0-9a19-e48a89728a5e@web.de>
 by: Helmut Richter - Sat, 7 Jan 2023 16:23 UTC

On Thu, 5 Jan 2023, Arno Welzel wrote:

> Helmut Richter, 2023-01-02 15:35:
>
> [...]
> > Now I have two ways to store web contents in the file system:
> >
> > classical: the URL <domain>/a/b/c is served from file <doc-root>/a/b/c/index.ext
> > which a suitable file extension (as a means to determine the content type),
> > typically .html
> >
> > abbreviated: the URL <domain>/a/b/c is served from file <doc-root>/a/b/c.ext
> > provided that there is no directory /a/b/c
> [...]
> > Are there any other reasons to prefer one of the methods over the other?
>
> I would stick with <doc-root>/a/b/c/index.ext and not allow the
> alternative <doc-root>/a/b/c.ext for the same URL to avoid confusion
> what <doc-root>/a/b/c means in your filesystem.

Thank you. After doing some testing with different configurations, I come to
the same result: this feature is really confusing.

E.g.: if <doc-root>/a/b/c.html is called by the path /a/b/c, relative URLs
(href="xyz") are relative to the fictitious directory /a/b/c. If, however,
<doc-root>/a/b/c.html is called as /a/b/c.html, relative URLs are, of course,
relative to the real parent directory /a/b. Same file contents, same file
name, same place in the dir tree, different semantics. Moreover, you can even
call the same file as /a/b/c/index.html even though /a/b/c does not exist,
then the spurious file name is treated as PATH_INFO.

So it should indeed not be allowed, as you suggest. It took me a while to
find out why weird things like paths to nonexistent directories and files
were allowed in the first place, and what to do to disallow them. The main
point was the MultiViews option which brings about most of the mess.

I will now use the following options as defaults:

Options All {disallows MultiViews}
Options -Indexes
DirectoryIndex index.html index.txt {and perhaps others, as needed}
AcceptPathInfo Off {unless needed for good reasons}

Then the path in the URL must be a valid file path resulting in a directory
(then one of index.* must exist there) or in an existing file. In all other
cases, a 404 or 403 status is returned. Simple rules, less problems.

--
Helmut Richter

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor