Running a Nibbler analysis on a static website I just built, I got the following feedback:
Avoid use of file extensions wherever possible. File extensions appear at the end of web addresses, and have several negative effects. They make the address harder to remember or type (particularly for non-technical users), and can reveal the underlying technology of the website making it very slightly more vulnerable to hackers. They also tie the implementation of the website to a specific technology, which can make subsequent migration of URLs difficult.
The above message is a result of having a flat directory structure and linking directly to the individual web pages (whatever.html). So is it really that much better to put every html file on a website in its own personal subdirectory (giving every webpage the file name index.html and relying on the directory name to identify the file) vs simply linking directly to the individual html files? I did some searching but didn't really find anything useful. This discussion had some info but didn't answer my question.
I'm curious to know what folks think of the two different approaches. Thanks.
/file-name/
is a directory./file-name
is a file./~johndoe/
convention, and you could say that is a directory too, which is kind of true, except that the directory is not called itself~johndoe
but more probably/home/johndoe/
, and this shows the abstraction/level of redirection (unrelated to HTTP redirections)