Configuring LocalHost Xampp Server for Virtual Hosts on windows
Installing LAMP Stack is an headache if your are new to developing and you wanna
create a virtual server for development mode on your pc and at that time Xampp comes on
handy. Xampp application is all in one package if you wanna install Php, Apache, Mysql and perl
and installing it is very easy. In this blog we will show how to configure virtual hosts in local xampp server.
By configuring virtual host we can assign different name to different directory instead of using
localhost/path_to_directory we can access that directory by name you configured. So Lets start
configuring virtual hosts.
Step1:- Edit Host File
To edit host file in windows we have to go to C:\Windows\System32\drivers\etc and edits hosts file and add the following to its end after that save it and close..
Step2:- Configure Virtual Host on Apache vHosts Config File
To edit config file we have to go to C:\xampp\apache\conf\extra and edit httpd-vhosts.conf file. Now we have to add some code at the end of this file which are :-
After editing config file close it and save it. Now your are all set just restart xampp server. Now your can access your project through your project name instead of full path to your directory. Cheers!!