I"m using xampp 1.8.1 and i have a problem in configuring my vhosts in apache But before that, I'm using windows 7 and i created first a dummy webpage so that I check if there are errors in the vhosts since Im new to xampp

These are the things that I did:

1. I created the hosts file in C:\Windows\System32\drivers\etc\hosts and i named my dummy website "works.localhost.dev"

but when I input this dummy url on my browser, it directs me to 404 error saying that object not found. I've check the configurations on my system, it seems I configure it correctly. I also tried to google on how to configure vhosts the right way but unfortunately, I doesnt resolve it. I am struggling from frustration for 5 days just to figure the problem

lastly I check the error.log of apache, i cant resolve it since im a new user of xampp.

I got rid of the NameVirtualHost, serveralias, added the changes in the hosts and also and follow your codes which you wrote but still its getting a 404 error page. I forgot to mention yesterday about my location of my directory of this site "works.localhost.dev" its in C:\xampp\htdocs\itworks also i input this in my url "localhost/works.localhost.dev". my bad

It looks like some codes in apache are deprecated, So this is the reason why my vhosts is not working.. but still my vhost doesnt recognize my dummy url. any idea?