3 ms·
> This is one of those "made up problems" as it only exists because you insist in doing magic, i.e. mapping /foo to either /foo/index.html or /foo.html. If the
by dotancohen 5y ago
> This is one of those "made up problems" as it only exists because you insist in doing magic, i.e. mapping /foo to either /foo/index.html or /foo.html.
If the underlying resource (web server) is Linux, then there is no magic. In Linux, everything is a file, including directories (maybe in Unix too, I don't know, I only work with Linux). So e.g. `/var/www/foo` is the same resource as `/var/www/foo/`. But without the context of the underlying filesystem being available to query that (e.g. with the `file` command) there is no way to know that `/foo` refers to a directory.
- brabel 5y agoWhen `index.html` is a file, does `ls index.html` show the same result for you as `ls index.html/`?
- dotancohen 5y agoI see, yes, if the server decides to send index.html when `index.html/` is requested, that is "magic" and your point is very valid.