Yes, from the front end. If a user is logged in if they try to access the dashboard page it will show their username in the URL so it would output - USERNAME/DASHBOARD.
I’ve just tried the code you posted and it still redirects to just /DASHBOARD.
Sorry my bad, Yes it does indeed work, although it redirects to an error page but the URL is now showing as I want it.
How would i go about showing the content from the dashboard page but upon a different URL? I wont be able to create a new page for each user if this makes sense?
Since username always points to the current user (which is determined by the session), the user does not need to be in the URL (this actually only creates a possible security issue when the name is not validated correctly).
I would create a page dashboard that dynamically inserts the user data into the page.
I think the main question is really what you want to achieve. Because even if you would get routing to work this way, it would just add an unnecessary layer of complexity and @lukasbestle’s suggestion sounds a lot more reasonable.