Nothing enforces a folder structure on a static site, which is why so many end up as forty files in one directory with names like page2-final-new. The conventions below are not rules, but they are what almost every project settles on eventually, and adopting them at the start is considerably cheaper than reorganising later.
A structure that scales
project/ index.html about/ index.html html/ index.html basics/ index.html assets/ css/ style.css js/ main.js images/ logo.svg Two principles are doing the work here. Content is organised by topic into folders that mirror the structure of the site, and everything that is not a page lives under a single assets directory. That separation means you can see at a glance which files are pages, and it keeps every stylesheet and script reference under one predictable prefix.
Why index files matter
A server asked for a directory will look for a default file inside it, almost always named index.html, and serve that. This is what allows a clean address ending in a folder name rather than a filename.
The practical effect is that placing your content in a folder named basics with an index file produces a tidier address than a file named basics.html sitting loose. It also means the folder can later contain the images and sub pages belonging to that topic, keeping related things together.
The second effect is a security one. A directory with no index file may list its entire contents to any visitor, depending on server configuration. An index file prevents that.
Naming files
Filenames become part of your addresses, so they are public and permanent in a way ordinary file names are not.
- Use lowercase throughout, because most servers are case sensitive and mixed case guarantees a broken link eventually.
- Separate words with hyphens. Search engines treat a hyphen as a word boundary and an underscore as part of a word, so hyphens make the address readable and the words individually recognisable.
- Avoid spaces, accented characters, ampersands and question marks entirely.
- Keep names descriptive but short. An address describing its content is easier to share, easier to remember and more likely to be clicked when it appears in a result.
Addresses are a commitment
Once a page is published, its address may be linked from elsewhere, bookmarked, or recorded by a search engine. Changing it breaks all of that. If a page must move, a permanent redirect from the old address preserves the links and the accumulated ranking, and setting one up is far less work than losing the traffic.
This is a good reason to think about naming before publishing rather than after. A structure chosen thoughtfully at the start rarely needs to change, whereas one that grew by accident usually does.
Keep assets out of the page folders
It is tempting to place an image beside the page that uses it. This works until two pages need the same image, at which point you either duplicate it or link across folders, and both get messy quickly.
A single assets directory with subfolders by type avoids that. Shared images, stylesheets and scripts each have one home and one root relative path that works from anywhere on the site. Genuinely page specific images can still live in a subfolder of assets named after the section they belong to.
Do not nest deeper than you need
Every folder level adds length to an address and a step to the mental model anyone has to hold while working on the site. Three levels of content nesting is comfortable and covers most sites. Beyond that, addresses become unwieldy to share, relative paths become harder to reason about, and the depth usually reflects an organisational scheme that made sense to the author and to nobody else.
If you find yourself four or five folders deep, the structure is likely describing categories that would be better handled by tagging or by a flatter arrangement with clearer names.
Files that belong at the root
A few files must sit at the top level because software looks for them at fixed addresses. A favicon, a robots file controlling crawler access, and a sitemap listing your pages all belong there. So does any verification file a search console asks you to upload.
Version control from day one
The habit that eliminates duplicate files with descriptive suffixes is putting the project under version control immediately. It costs two commands, it removes any reason to keep a copy of a working file before editing it, and it means an experiment that goes wrong is one command away from being undone rather than something to be reconstructed from memory.