Domain alias redirecting to parent URL and Subserver default web directory change

3 posts / 0 new
Last post
#1 Wed, 02/20/2019 - 15:36
Axis100

Domain alias redirecting to parent URL and Subserver default web directory change

I have an application which delivers different content based on the domain.

"parent.com" hosts the application and I set up an alias "child.com" in virtualmin. Everything works great, they act as two separate websites even though it is just one single php application in parent.com's web folder. I also have SSL with both domains on the certificate, so everything is great.

ISSUE 1) Then I add "third.com" as a new alias to parent. When I try to access "third.com" in the browser it instantly redirects to "parent.com" and displays "parent.com" in the address bar.

Is this something wrong with .conf file in apache? DNS? Is there some kind of virtualmin create-new-vhost default setting that is incorrect? I need to fix this before I add more domain aliases, I intend on using many of them.

ISSUE 2) I tried using a subserver instead, (I would prefer to use subservers because I'd like each site to have it's own SSL certificate). But I couldn't figure out how to redirect /home/parent.com/domains/third.com/public_html (default subserver webroot for third.com) -- to -- /home/parent.com/public_html (intended subserver webroot for third.com)

Any help fixing the broken alias, and/or advice on how to set subserver's default webroot to parent's webroot would be appreciated, thank you.

Sat, 12/21/2019 - 09:22
thierry
thierry's picture

I have the same problem

Sat, 12/21/2019 - 14:55
adamjedgar

I think sub server redirect would be via a htaccess file in the sub server public html folder with url masking wouldn't it?

Can I ask, with your alias, does it actually work properly when one enters https://domain2.com in browser? Does that redirect to https://domain1.com or do you get an error?

I am finding the redirect for alias only works when one does not enter https in browser (only http).

E.g. http://domain2.com goes to https://domain1.com

But

https://domain2.com throws an SSL error (even though I have this domain in domain1.com SSL cert)

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Topic locked