This is an example of how I set up subdomains for my local xampp installation.
note: any changes to httpd.conf requires an apache restart
in http.conf - make sure this line is not commented
Add a virtual host, example:
this folder (/xampp/www/) is where I keep all of my 'sites'
Then go to Applications -> Utilities -> NetInfo Manager
Administration rights are needed, click on the padlock and enter
Select 'machines', there will be an item called localhost, select it and click on duplicate.
On the copy - rename the 'name' to the URL, in my example, it would be wordpress.localhost
Save and update.
When you using virtual host I'm pretty sure I had to set up localhost as well, e.g.: