How to organise a website's files
A sensible folder structure inside public_html saves far more time than it costs to set up, especially once a site has grown past a handful of pages.
A website's file structure rarely gets planned on purpose. It grows one upload at a time — a logo here, a PDF there, a folder created for a page that later got renamed — until finding anything means scrolling through a long, unsorted list and guessing. None of this is inevitable. A small amount of structure, applied early and kept up, pays for itself many times over the life of a site.
Start from what public_html actually is
Everything inside public_html is reachable by a visitor at a URL that mirrors its folder path. A file at public_html/images/logo.png is reachable at yourdomain.com/images/logo.png. This is worth keeping in mind because it means your folder structure is not just an organisational nicety for you — it becomes part of your site's actual URLs, at least for anything not handled by an application with its own routing.
A structure that works for most sites
If you are building or maintaining a straightforward site rather than running a large application like WordPress — which manages its own structure — a small number of top-level folders covers most needs:
| Folder | What goes in it |
|---|---|
/images | Photos, logos, icons and any other image assets, ideally with their own subfolders if the site has a lot of them. |
/css | Stylesheets, kept separate from the pages they style. |
/js | JavaScript files, similarly separated out. |
/downloads or /files | PDFs, documents and anything meant to be downloaded rather than displayed. |
| Top level | Your homepage and other top-level pages, kept at the root so their URLs stay short and memorable. |
The exact names matter less than having some structure at all and sticking to it. A site with everything — HTML, images, PDFs and stylesheets — sitting loose at the top level is not broken, but it becomes steadily harder to work in as it grows, and it makes URLs longer and less predictable as new sections get added without a clear place to put them.
If you are running an application, respect its structure
Platforms such as WordPress, and most other content management systems, come with their own folder conventions and expect specific things to live in specific places — themes, plugins, uploads and core files each have a defined location. Do not restructure these folders to match your own preferences; the application relies on the layout it was built with, and moving things around inside it is a common way to break updates and functionality that otherwise work automatically. Keep any custom, non-application content in a clearly separate folder instead of mixing it into the application's own structure.
Naming files consistently
A few small habits make a real difference once a site has more than a handful of files:
- Use lowercase, with hyphens instead of spaces.
summer-sale-banner.jpgis safer across different servers and operating systems thanSummer Sale Banner.jpg, and avoids the case-sensitivity trap where a link written asLogo.pngfails to find a file actually namedlogo.png. - Avoid special characters. Spaces, ampersands, and punctuation beyond hyphens and underscores can cause problems in URLs and in some tools that were not designed to handle them.
- Be specific rather than generic.
homepage-hero-2026.jpgtells you far more six months later thanimage1.jpgdoes, particularly once a folder has accumulated dozens of similarly generic names. - Date-stamp anything that will be replaced periodically. Reports, price lists, or seasonal graphics are easier to manage with a date in the file name than by relying on modification dates alone, which change every time a file is touched for any reason.
Keeping it tidy as the site grows
Structure decays gradually rather than all at once, so it is worth a periodic check rather than a one-off effort. A few minutes every few months looking through public_html for files that no longer belong, duplicates from testing, or a folder that has quietly become a dumping ground is usually enough to keep things manageable, especially compared with the time a proper clean-up takes once things have been left for years.
Most file managers and FTP clients let you sort a folder by the date a file was last changed. Sorting this way after a busy period — a redesign, a big content push — makes it easy to spot temporary files that were never cleaned up afterwards.
Hidden files still count
Configuration files such as .htaccess are part of your file structure even though they do not show in a default listing. Know where they are and what they do before restructuring folders around them, since moving or renaming a file that a hidden configuration file specifically refers to can silently break rules that depend on that exact path. See what hidden files are and how to see them if you have not looked at these before.
When you cannot find something
Even a reasonably organised site eventually has a file nobody can immediately place. Rather than guessing, use your file manager's search feature or connect over FTP and check by date modified — finding a file on your hosting account covers both approaches in more detail. And if you are just getting started and are not yet sure what belongs where at all, what public_html is is worth reading first.
Related reading
It is the one folder on your hosting account that visitors can actually reach. Everything your site shows has to live inside it.
What are hidden files, and how do I see them?Files whose name starts with a dot, like .htaccess, are hidden by default in most listings until you turn on show hidden files.
How to find a file on your hosting accountUsing the search built into your file manager, or narrowing it down folder by folder in an FTP client, when you cannot remember where a file went.
FTP, FTPS and SFTP: which to useThree protocols with confusingly similar names, one of which sends your password in the open. Here is what actually separates them.