How to - multiple domain names point to same virtualhost?

I am using a translation plugin for WordPress and it suggests that I setup multiple domain names, one for each language that I am going to use on the website.

Here is what they suggest I do, and I am asking how do I do this with virtualmin?

The easiest way is to have a single VirtualHost entry for all domains and use ServerAlias instructions to tell Apache to answer the different domains with the same virtual host.

For example:

VirtualHost *>
DocumentRoot /your_wp_install_directory/wordpress

… your other stuff here …

This tells Apache that there’s a single WordPress install which answers to requests from and It doesn’t matter of those are completely different domains or sub-domains.

***I’m pretty sure there is a way of doing this in virtualmin in a way that will make total sense and will actually show up properly in virtualmin.

Is there a good source of documentation on how to do this?

thank you for helping.

Actually I forgot to add, it is going to be a little bit more tricky.

I am going to be running store software on this website, so I will be adding an SSL certificate to the virtualhost.

I am not sure how/if it is possible to have this work, where there are 2 domain names on the same virtualhost/ip (I have dedicated ip for this virtualhost) that use the same SSL cert.

I know that this question, is almost a totally separate issue, but knowing I will be adding SSL to the virtualhost, I wanted to mention it, just in case it changes how I should be setting this up.


Well, I’m not sure I entirely understand what you’re describing in your second comment regarding SSL… however, the first half of what you’re asking is straight forward.

All you need to do is setup a Virtual Server – and then add aliases to that Virtual Server.

Before you add those aliases, just make sure that in System Settings -> Server Templates -> Default -> Apache Website, that the “Create alias websites by” option is set to “Adding ServerAlias to parent”.

As far as SSL goes with that setup – if you have a Virtual Server that contains a series of aliases, you could only have one SSL certificate for all of those… but all of the domains would be able to make use of that one SSL certificate (though they’d receive a browser warning if their names didn’t match the name listed in the SSL cert).


This is what I did for a client’s Wordpress MU installation.

Turned on “Website matches all sub-domains?” Under “Server Configuration” -> “Website Options”
This will make apache answer for etc

Install a wildcard SSL certificate, these are more expensive, but the only easy way to do this.

Thank you so much for the detailed answer. It worked perfectly and introduced me to the proper use of aliases.