.htacces redirect for website and subdomain [closed]


I have a WordPress installation and a wildcard certificate.

Now I want to configure via .htaccess file the following:

Redirect http(s)://(www.)example.com to the URL https://www.example.com but links to http(s)://staticsub.example.com to the URL https://www.example.com/catecory/staticsub (if possible, that it shows in addressbar https://staticsub.example.com).

Is it possible? And if yes, how?