When members log in, how can they be redirected to their dynamic page?

Hi!

I’m thinking of it like this:
+ member logs in - member role: teacher - member title: ottoschmidt
+ member is redirected to their dynamic page: sitedotcom/teacher/ottoschmidt

+ member logs in - member role: teacher - member title: joanadams 
+ member is redirected to their dynamic page: sitedotcom/teacher/joanadams 

+ member logs in - member role: student - member title: laurasmith 
+ member is redirected to their dynamic page: sitedotcom/student/laurasmith 

+ member logs in - member role: teacher - member title: garylopez 
+ member is redirected to their dynamic page: sitedotcom/teacher/garylopez 

I have a variety of user roles, the name matched the dynamic page name and the collection they are based on.

I guess the only way to do it is to add code. I tried a few versions I found online and none worked. I tried to learn about routers and hooks, but didn’t understand it either.

Any ideas?

Thanks!