I use WordPress.
I know how to redirect a user to a specific page after logging in. But let's say they have already logged-in and they click specific URL, they should be redirected to another.
Sample: usernameA The user has already logged-in. He clicks domainname.com/my-account He will be redirected to domainname.com/pageA
usernameB The user has already logged-in. He clicks domainname.com/my-account He will be redirected to domainname.com/pageB
All of them click the domainname.com/my-account but they have to be redirected to a different page.
This redirection is per user. Is there a way to do this in function.php?