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 *:80>
    DocumentRoot "F:/xampp/htdocs/devel/laravel/public"
    <Directory "F:/xampp/htdocs/devel/laravel/public">
	Options Indexes FollowSymLinks ExecCGI Includes
        Order allow,deny
        Allow from all

Step 2:

Edit your Windows hosts file.

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

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


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