Hi all
I have been testing php pages loacl for ages now and always just struggled with the standard setup of xampp in terms of directory issues with the live site.
So thought its time to figure out how to have multiple domains local, that are basicly copys of the real domain but with .lh instead of .com or .co.uk
So found this blog post and ran through it, but it did not seem to work.
How To Set Up Virtual Hosts In XAMPP ? Return True
After having a play around with what it had instructed for a while managed to get it to work but had to assign a different IP for each new domain and then put that domain inplace of the * where it says:
Would this be ok doing it this way instead?
According to the articles I have seen you should be able to setup your windows host file like this for example:
Code:
127.0.0.1 localhost
127.0.0.1 total-fleet-management.lh
127.0.0.1 car-maintenance-package.lh
But I had to do it like this
Code:
127.0.0.1 localhost
127.0.0.2 total-fleet-management.lh
127.0.0.3 car-maintenance-package.lh
Then they say you should be able to set your apache vitualhostfile like this:
Code:
<VirtualHost *:80>
ServerAdmin webmaster@dummy.example.com
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
ServerAlias localhost
ServerAdmin webmaster@dummy.example.com
DocumentRoot "C:\xampp\htdocs\Fleet-Management"
ServerName total-fleet-managemet.lh
ServerAlias total-fleet-management.lh
ServerAdmin webmaster@dummy.example.com
DocumentRoot "C:\xampp\htdocs\Maintenance-Site"
ServerName car-maintenance-package.lh
ServerAlias car-maintenance-package.lh
</VirtualHost>
But I have had to do it like this
Code:
<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@dummy.example.com
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
ServerAlias localhost
</VirtualHost>
<VirtualHost 127.0.0.2:80>
ServerAdmin webmaster@dummy.example.com
DocumentRoot "C:\xampp\htdocs\Fleet-Management"
ServerName total-fleet-managemet.lh
ServerAlias total-fleet-management.lh
</VirtualHost>
<VirtualHost 127.0.0.3:80>
ServerAdmin webmaster@dummy.example.com
DocumentRoot "C:\xampp\htdocs\Maintenance-Site"
ServerName car-maintenance-package.lh
ServerAlias car-maintenance-package.lh
</VirtualHost>