→url() produces wrong path

So I have the following folder structure:

My template code calls for the URL of data’s children.

But only the two folders with short names seem to get the correct URL:

In addition, clicking on one of the links with the correct URLs gives me an error 404.

Is this my wrongdoing or an issue with Kirby 4?

If you use the Panel, it would have sluggified your page folder names. I’m not 100% sure if dots are allowed at all, but the issue is definitely caused by the underscores. If I were you, I’d remove both dots and underscores (and any other weird characters) from the page slug.

The underscore is used by Kirby to denominate the numbering scheme for listed pages.

Can you open the bla page without metadata.json part?

Thanks for clearing up the URL issue.

The 404 error just got weirder. Nothing apart from the homepage loads now and the images on the homepage are blank (I am using the starter kit). Just to make sure I copied over a brand new starter kit and the issue persists. I swear it was working just a few hours ago. Not sure what is wrong here. Need to investigate.

On the hosted server it works just fine. Must be something with mam MAMP setup.

Yes, mod_rewrite is by default disabled on MAMP, they changed that some versions ago: Broken Images and subpages on Mamp (mod_rewrite was disabled)

That was it. I updated MAMP between sessions. What a silly move on MAMP‘s part to disable that by default.