thanks! 🙂
in that first link I gave you, there was another hook that creates a login form, and if your WHMCS contains the username/password to their service, then that can be used to login directly to their cPanel...
... though i'd suggest changing http to https and adding 1 to the ports uses for cPanel/Webmail (2083 & 2096)...
that second link I gave you does contain an updated version of the above hook that doesn't need username/password for the cPanel link, but it uses the default URL of clientarea.php?action=productdetails&id=xxx&dosinglesignon=1 for the cPanel link - which is no good for you as that's the URL you're having problems with.
if you can't get that second hook to suit your needs, then as @penguin suggests, you might be better off changing your WHM (not WHMCS) redirection settings - you may need to contact your host for help with that.