Hi Wonder if anyone can help.

I have trying to get virtual hosts working on a local installation of xampp with not much success for the last few hours, all the numerous examples I have tried just seem to point to the same thing - it looks pretty simple, set hosts & add into httpd-vhosts.

The hosts file part seems to be working but I'm unsure about the virtual host part.

The problem is it just loads up the xampp welcome page.

Ideally I want to set up so the virtual hosts point to a mapped drive, but for the moment I'd be happy with just pointing to a folder in the htdocs !

Is there a way to check that my virtual hosts part is working ?



Use name-based virtual hosting. # NameVirtualHost *:80

#ServerAdmin webmaster@localhost DocumentRoot "C:/xampp/htdocs/testdomain" ServerName www.testdomain.com ##ServerAlias www.dummy-host.localhost ##ErrorLog "logs/dummy-host.localhost-error.log" ##CustomLog "logs/dummy-host.localhost-access.log" combined #Options Indexes FollowSymLinks Includes ExecCGI

localhost name resolution is handled within DNS itself.       localhost
#::1             localhost

virtual hosts www.testdomain.com


Try removing the # from this lines

NameVirtualHost *:80


ServerAlias www.dummy-host.localhost

Change www.dummy-host.localhost to www.testdomain.com

Then restart xampp.

I believe you would also need to add this to your hosts www.testdomain.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.