'How to 301 redirect site alias domain to a subdomain on the same hosting?

We have the following problem in Cpanel / htaccess file when trying to 301 redirect example.hu (alias) pages to example.com (subdomain) pages:

Cpanel example.hu to example.com redirection is working, but any additional 301 page redirects won't work and redirect the (alias) example.hu/hu/page to the main domain's home page (anotherdomain.example).

Main domain & the alias domain (alias domain is also added as subdomains to Cpanel) share the same root directory, could this be the problem? Should I remove the alias domain and changes to Cpanel 301 redirect / .htaccess file modification will start to work?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source