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

Ticket: https://tracker.phpbb.com/browse/PHPBB3-13073
The issue is that the phpBB root path looks like ```./../``` if we're in the acp or similar subdirrectories. For one, we get some weird double slash as VSE mentioned. Therefore we remove the trailing slash, but this gets even worse on pages like index.php. In that case, the root path could just be ```./``` which means removing the leading backslash will cause major issues as you will now have a dot in your path for no reason. A better regex might help with this though.