Down to Brass Tacks Let's cut the crap.

27Jan/10
4:34 pm
0

Index Files

It's been said that you should only have one "index" file per website—in the root folder. Well, you should definitely have at least one index file (in the root folder), but that would mean that you would have a structure such as this,

Index files - Single index file, structured

which would have the unfortunate side effect of creating rather redundant links, such as "/portfolio/portfolio.html". Well, yes, thank you, but I expected the portfolio folder to contain a web page for the portfolio!

Quite frankly, for such a simple website, the designer could just as well have opted for placing all the (html) files in the root folder, like this,

Placing all the html files in the root folder

with all the relevant assets (such as images) placed in subfolders, of course. It could be argued that, for the sake of being super tidy, well structured, in case the website becomes bigger and assets get harder to manage, that it would be simpler for everything to be clearly separated in subfolders. True. But then for a bigger website, I would argue that assets would probably be managed by a database, not by a folder structure (which is kind of "old think"), so this would not be so important.

Now, if we want a compromise between the two situations, we will come back to the root of this post—index files. It just ain't true that you can't use multiple index files! It's only one index file per folder, not per website. You would get the following, very simple and straightforward structure:

Using multiple index files in a structure

By doing this, you would keep the super tidy structure, and as a bonus, you would also get simple links such as "/portfolio/". Also, if at some point you decide to add features to your site by switching from static html pages to say, PHP files, you wouldn't even have to update links...

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.

Recent Posts

Categories

Recommended

Meta