It really is impossible to help if you don't provide all the details in the first place - see what can be done when you include enough detail to be able to effect a solution.
Try this but you will have to change the paths to suit your own if they are wrong and add this below the last ##comment lines:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName MyWebsite
ServerAlias www.MyWebsite
DocumentRoot "D:/MyWebsite"
<Directory "D:/MyWebsite">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
AllowOverride All is the default which is usually used by most and here are the Apache docs for that directive just so you know what you are doing when you use the
AllowOverride FileInfo directive:
http://httpd.apache.org/docs/2.2/mod/co ... owoverride
For a complete list of Apache directives for reference:
http://httpd.apache.org/docs/2.2/mod/directives.html
ServerAlias is used for another name for your server not the same name as your server.
Always remember that Apache is case sensitive - MyWebsite is very different to mywebsite.
All the lines starting with a
# or
## are comments and take no part in the running of the httpd-vhosts.conf file and are only for help with configurations.
Drag this file into your text editor
C:\WINDOWS\system32\drivers\etc\hosts
and add these lines if they are not there already:
127.0.0.1 localhost
127.0.0.1 MyWebsite
Save the file.
Restart Apache to have your edits in the httpd-vhosts.conf file recognozed.
Now you should be able to access your sites like this:
http://localhost = XAMPP Welcome Page
http://MyWebsite = your website.
http://www.MyWebsite = your web site
Make sure you clear your browser's cache regularly when developing and more so at localhost level as the cache can be your worst enemy serving you old pages stored in the cache.