Sunday, December 25 2016

Setup multiple virtual host on xampp for windows

In this post we have explained about the how to setup the vitual host on xampp for our windows.
We can able to create more than one virtual host on our machine.
Why we are for create virtual host, to optimize the home page URL for all projects.

Step 1:

Point your directory on F:\xampp\apache\conf\extra\httpd-vhosts.conf.

  • Open the file named httpd-vhosts.conf with a text editor.
  • Around line 19 find # NameVirtualHost *:80 and uncomment or remove the hash.
  • Add below code at the bottom of that file.
  • Modify your directory path in below code.
<VirtualHost *:80>
    DocumentRoot "F:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "F:/xampp/htdocs/devel/laravel/public"
    ServerName laravel.dev
    <Directory "F:/xampp/htdocs/devel/laravel/public">
	Options Indexes FollowSymLinks ExecCGI Includes
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Step 2:

Edit your Windows hosts file.

C:\Windows\System32\drivers\etc\hosts

127.0.0.1       localhost
127.0.0.1       laravel.dev

Step 3:

Once you have updated those above changes in your files and restart xampp.

Thanks for reading this article. If you have any queries and please comment in the below.

Share Your Thoughts

phpexpertise

I’m Blogger and Programming Blog, Tutorials, PHP, MySQL, jQuery, Laravel, Wordpress and Codeigniter