Navigating a directory structure where folders contain spaces

I’d like to navigate an existing directory tree where some of the folders contain spaces.

Unfortunately I can’t rename folders or add text files so I’ll be using the default template to navigate.

The code below works but fails when it hits a folder with spaces.

http://site.dev/Test-One/Test%20Two
This leads to kirby’s error page.

Any ideas?

Thanks!

<ul>
  <?php foreach($page->children() as $subpage): ?>
  <li>
    <a href="<?php echo $subpage->url() ?>">
      <?php echo html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>

Could this be solved through routing or .htaccess? Or would the kirby core need to be modified?