My goal is:
*a.example1.com* should point to *example2.com/test*
- The hosting machine for example2.com has the SSL certificate (wildcard) *.example2.com
- I manage both domains.
Solutions I thought of:
Creating a subdomain test.example2.com pointing to content under '/var/www/site/test'. (subdomain should point to the same machine)
Create a CNAME record as such: a.example1.com CNAME test.example2.com
This will cause an SSL certificate issue on the browser. So, I need to install the SSL certificate for a.example1.com on the host machine for example2.com and more precisely on the virtual host test.example2.com. However, I am not sure this is even possible? I found this source on how to have two virtual hosts in apache with two different domains and therefore with different SSL certificates: So If I do the following:
Create a virtual host for test.example2.com --> pointing to '/var/www/site/news' and having the wildcard certificate '*.example2.com'
Create another virtual host for a.example1.com --->pointing to /var/www/site/test and having the wildcard certificate 'a.example1.com' (on the same machine)
And Created the following record:
a.example1.com CNAME to test.example2.com
Would that solve my problem?