You could do something like I have done. I needed to have multiple websites set up on my system (for development purposes), and I have done this:
Created multiple hostnames that point to 127.0.0.1 (e.g. localhost-site1, localhost-site2, etc) in the c:\windows\system32\drivers\etc\hosts file.
- Code: Select all
127.0.0.1 localhost
127.0.0.1 localhost-site1
127.0.0.1 localhost-site2
Then in the httpd.conf file, you can set up virtual hosts such as:
- Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "c:\apachefriends\xampp\htdocs"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "d:/site1/htdocs"
ServerName localhost-site1
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "d:/site2/htdocs"
ServerName localhost-site2
</VirtualHost>
So you could have as many localhosts pointing to different directories as you would need. This can also work if you need just one host. And the regular localhost would still load the standard XAMPP pages as it did when you first installed it.
Hope this helps you.