A folder takes precedence over a file with the same name
What you'll see
A single landing page should grow into a section with its own subpages – for example Kunstig intelligens.hash (served at /kunstig-intelligens) should become an overview with pages under /kunstig-intelligens/ai-agent, /kunstig-intelligens/chatbot and so on. The natural step is to create a folder with the same name next to the file and start adding pages to it.
What's actually happening
Verified with a scratch file and a scratch folder of the same name on a live site:
/nameanswers 301 to/name/./name/renders the folder'sindex.hash. The file with the same name is no longer reachable./name/subpagerenders pages in the folder as normal.
So the moment the folder exists, it takes the URL over from the file – before you have put anything in it. An empty folder without index.hash turns a working page into a 404.
The upside: the old address keeps working through the 301, so moving a page into a same-name folder needs no redirect file.
What to do
Do – build under a temporary name, rename when ready:
- Create the folder under a name that is not in use (e.g.
kunstig-intelligens-ny), withindex.hashand the subpages. Review it at its temporary URL. - Take a copy of the old file (
docly get --raw). - Rename the folder to the final name (
docly rename). From this moment the folder serves/name/, and/nameanswers 301 to it. - Delete the old file – it is unreachable anyway, and leaving it invites confusion.
- Update the sitemap (
/name/instead of/name) and internal links.
Don't create the final folder first and fill it afterwards – the live page is gone until index.hash is in place.
If index.hash lists the folder's pages, derive the folder from the request instead of hard-coding it, so the same file works at the temporary and the final name.