Configure apache2 virtual host subdomain

you can use a wildcard to match any subdomain name in apache:

serveralias *.website.local

the problem is the hosts file doesn't support wildcards. if you use a local dns bind service as a resolver you can register the website.local zone and create the dns wildcard as well.


In apache.conf:

ServerAlias *.website.local

However it is not possible to use wildcards in /etc/hosts. You would need to setup a DNS server for that.