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

Ticket: https://tracker.phpbb.com/browse/PHPBB3-13073
I don't see why you need these two preg_replace. That should be the job of filesystem::clean_path() to clean the path from the dot and the double /