Is there really no way to set up urls in a logical hierarchy?

I’ve scoured the forums and as far as I can tell I can’t do something basic like the following URL if I have a User and a posts page that where the page has a User as it’s data type:

mydomain.com/username/posts

The only thing I can do is mydomain.com/posts/username which is an initiative hierarchy I’ve never seen on any website.

I know I can use URL parameters but that isn’t what I’m looking for.

Is there ANY way to do what I’m looking for?

Thanks