You want to do mass virtual hosting on Apache. Here you will find the information how to do that:
Dynamically configured mass virtual hosting
Based on the example from the tutorial you've linked:
NameVirtualHost *
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "C:\Documents and Settings\Me\My Documents\clientA\website"
ServerName clientA.local
<Directory "C:\Documents and Settings\Me\My Documents\clientA\website">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot "C:\Documents and Settings\Me\My Documents\clientB\website"
ServerName clientB.local
<Directory "C:\Documents and Settings\Me\My Documents\clientB\website">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
The problem concerning this configuration is, that it's static and you need to restart Apache when you change it.
At first, you need an record in your DNS server to map all subdomains to your server. Like this:
*.local. 3600 IN A x.x.x.x
To test this on localhost, you can set some subdomains in your hosts
file manually. See here why it is not possible to set a wildcard subdomain in the hosts
file.
Don't forget to load the vhost_alias_module in httpd.conf:
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Then you will replace you vhost configuration, like this example:
<VirtualHost *>
# get the server name from the Host: header
UseCanonicalName Off
# this log format can be split per-virtual-host based on the first field
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot "C:/Documents and Settings/Me/My Documents/%1/website"
<Directory "C:/Documents and Settings/Me/My Documents/*/website">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
DirectoryIndex index.php index.html index.htm
</Directory>
</VirtualHost>
This will use a wildcard to set the document root of the subdomain requested.