'Set up apache web server to route traffic from multiple places to one site

I want to achieve that mutiple subdomains, like sub1-domain.org, sub2-domain.org, sub3-domain.org will be routed to the one and only site at my apache web server in the directoy C:\wamp\www\mediawiki. I am using wamp with an apache server version 2.4.51.

I tried it with virtual hosts:

# httpd-vhosts.conf
#Virtual Hosts
<VirtualHost *:80>
    ServerName localhost
    ServerAlias localhost
    DocumentRoot "C:\wamp64\www"
    <Directory "C:\wamp64\www">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName wiki.org #<-- changed it in host file (127.0.0.1 wiki.org)
    ServerAlias sub1-wiki.org sub2-wiki.org sub3-wiki.org # <-- changed it in host file (127.0.0.1 sub1-wiki.org)
    DocumentRoot "C:\wamp64\www"
    ProxyPass "/" "http://localhost/mediawiki"
    ProxyPassReverse "/" "http://localhost/mediawiki"

ErrorLog "logs/vrr-wiki.log"
CustomLog "logs/vrr-wiki.log" common

but it wasn't successful. It is rooting me back to localhost where I see the wamp server site. What I want to achieve is to setup a wikifamily, like it is described at this site: https://www.mediawiki.org/wiki/Manual:Wiki_family Until now I am not realy successful, because I am not familiar with server configuration at all... If there is another way to achieve that subdomains will point to my main site, please let me know. I am not sure if you need any more information. If yes let me know.

Thank you for your help in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source