I have two domains setup in virtualmin.
The main domain is pihost.online
The other is pihost.li
When visiting pihost.li it automatically redirects to pihost.online
This is exactly what I want but i don’t understand which setting is causing this behaviour.
Why is pihost.li not redirected to the original landing page of virtualmin (within its own home folder)
I haven’t setup a redirect with pihost.li to pihost.online
This is probably a case of “the wrong site shows up” and is unrelated to the domain names. Those are two different names…nothing in Virtualmin or Apache would treat pihost.online as being the same domain as pihost.li. It’s a human trait to think those two different names are the same, somehow.
Note that this can be caused by a wide variety of misconfigurations. If you have IPv6 enabled, but misconfigured, that can do it. Mixing * and IP based VirtualHost definitions can do it. Having multiple IP addresses, but misconfigured, can do it. If you’ve got web apps installed from the Debian repository that include their own web server configuration, that can cause confusing VirtualHost problems.
Thank you very much Joe for your reply. The troubleshoot guide did help me a bit. I actually figured it out by checking the config files for pihost.li in apache2. I figured out that line number 95 was a redirect to pihost.online for ssl requests. And i enabled forward none ssl requests to ssl website. See attached screenshot. After commenting this line out and disabling forward ssl requests for every request (http / https) the actual landing default landing page of virtualmin appeared. I’m glad i now understand WHY it does things as it does. This will be very helpful for future domains.