Let’s see how virtualhost are created in Xampp, although this is very similar in any version of Apache.
Step 1. Enter the file C:\xampp\apache\conf\httpd.conf and add or uncomment the include of the virutal hosts file:
# Virtual hosts Include conf/extra/httpd-vhosts.conf
Step 2. Enter the file C:\xampp\apache\conf\extra\httpd-vhosts.conf and add the virtualhosts, in my case I will create a virtualhosts, one for a new project created with laravel.
# LARAVEL PROJECT <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/laravel" ServerName laravelproject.com.devel ServerAlias www.laravelproject.com.devel <Directory "C:/xampp/htdocs/laravel"> Options Indexes FollowSymLinks AllowOverride All Order Deny,Allow Allow from all </Directory> </VirtualHost>
Step 3. Add to the hosts file of our system, in the case of Windows C:\Windows\System32\drivers\etc\hosts , and add the IP and url.
What we are telling you is that when we load any of those domains we call the IP that we indicate in this case 127.0.0.1 instead of the original IP of the domain if it has one.
Now if we go to http://laravelproject.com.devel we will open the web we have in our directory www