in reply to Mojolicious url rewriting

If I understand correctly what you want to do, then doing it in code is perhaps not the best approach. Instead you can use the .htaccess file to control the redirect and display the appropriate URL in the browser.