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 *:80>
ServerName http://your-domain-name/
DocumentRoot C:\xampp\htdocs\your-project-name\
#ErrorLog "logs/"
#CustomLog "logs/" common
SetEnv APPLICATION_ENV "development"
<Directory C:\xampp\htdocs\your-project-name>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all

2) Go to C:\Windows\System32\drivers\etc and modify the hosts file.  localhost  your-domain-name

3) Re-start the apache.

Be the first to comment

Leave a Reply

Your email address will not be published.