[ticket/13073] Correctly generate routes from subfolders like /adm

Ticket: https://tracker.phpbb.com/browse/PHPBB3-13073
please also test for adm/subdir/index.php, adm/../bertie/index.php and ../bertie/index.php