Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ?

Thanks

MRO

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.

127.0.0.1       localhost
#::1             localhost

virtual hosts

127.0.0.1 www.testdomain.com

share|improve this question

1 Answer 1

Try removing the # from this lines

NameVirtualHost *:80

and

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

127.0.0.1 www.testdomain.com

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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