Setting up a Virtual Host with XAMPP on window 10

Use below 3 steps to configure virtual host in xampp or wamp in window 8 and window 10:

1) Go to C:\xampp\apache\conf\extra and modify httpd-vhosts.conf add below code:

<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerName http://your-domain-name/
DocumentRoot C:\xampp\htdocs\your-project-name\
#ErrorLog "logs/dummy-host2.example.com-error.log"
#CustomLog "logs/dummy-host2.example.com-access.log" common
SetEnv APPLICATION_ENV "development"
<Directory C:\xampp\htdocs\your-project-name>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

2) Go to C:\Windows\System32\drivers\etc and modify the hosts file.

127.0.0.1  localhost
127.0.0.1  your-domain-name

3) Re-start the apache.

Be the first to comment

Leave a Reply

Your email address will not be published.


*