Subserver web traffic going to parent's folder???

I have set up “” on my server. I have also set up a subserver called “”.

DNS is resolving ok for both. However, when I enter in a browser, I do not see the files that are in


but rather the files in:


My browser address bar still reads “” though. Its as if the name-based forwarding in Apache is not working properly in this case.

Any ideas???

This may or not be worth mentioning - but I just saw that the https version of DOES point to the correct web folder…

A wild guess… Since you’re saying you have SSL set up for both the parent and sub server, do you have separate IP addresses assigned to them? If so, you might want to check if the Apache config is correct in terms of IP addresses.

Another hunch would have to do with what exactly the (sub-)domain name is. Virtualmin “reserves” a few subdomains for its own use, like “”, and trying to create a subserver with that name leads to serious confusion. :slight_smile:

I have a top level virtual server
Everything works fine for that domain.

I have a virtual sub-server on the same account - Note it is not a subdomain

If I don’t have any files in’s public_html folder, references to return the index file for THat’s pretty strange.

If I put a file hello.html in’s public_html folder then is returned ok. But still returns index file.

As long as I have an index.html (or index.php) in’s public_html folder I’m ok. It shouldn’t be required but I can live with that.

Now I have a further problem. In I renamed a few pages and added rules in .htaccess to redirect old links to the new pages.
So I have, for example
Redirect permanent /contact/
in the .htaccess file in’s public_html folder

That works fine: is redirected to

But references to are also redirected to
and worse are redirected to

In this case the log files for have entries for this request, and those for do not.

What is going on? Why is Apache even referencing .htaccess in the documentroot of for requests with the domain

I am very well versed in running servers, I worked with apache since 1.1 days. I can see no reason for this happening. The virtualhosts files for both domains are perfectly fine. I can’t find a debug option for apache which will show me how it is processing .htaccess files. Plus this is a production server so I don’t want to turn too much debugging on if I can help it.

Any help will be appreciated.

Edit: If I remove the .htaccess rules from, it still happens, even after restarting apache. In fact in the small hours I restarted the server after an OS update and it still happens.

A rather complex thing… I fear my “by-heart” knowledge of Apache and how it chooses domains to serve is not sufficient to venture a guess here without seeing the configuration files for myself… I.e. I’d need access to the system in question and test stuff out. Wouldn’t want to mess with your production server though.

So at this point, the best advice I can give would be to check out the Apache documentation. It has an extensive chapter about choice of virtual domains (see below), and likewise about .htaccess files and redirects (for which there are multiple ways to implement them).