How to Create Virtual Host on LocalHost

Posted by

In this tutorial i’m going to describe how to create virtual host in Laravel in easy way mentioned below.

Virtualhost :- Virtual Host is a hosting multiple domain names on a single server.

Every time running a Laravel project with the command “php artisan serve” may be painful. Virtual hosts in xampp to handle multiple projects because that’s easier than accesing the direct path with the localhost URL.

Please follow some easy steps mentioned below.

first stop your xampp ?

1step-> Go to


ds-admin-ms is my project folder name


2nd step go to


3rd step Open this file -> httpd-vhosts.conf

4th step Copy below code ??

<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\ds-admin-ms\public"
ServerName ds-admin-ms
ServerAlias ds-admin-ms
<Directory "c:/xampp/htdocs/ds-admin-ms/public">
Order allow,deny
Allow from all

Next step go to


Open this file -> hosts

Note: Remember to edit the hosts file using an editor with administrator rights, otherwise you won’t be able to save the changes.

Simply copy below code ? 		ds-admin-ms

Paste here in C:\Windows\System32\drivers\etc and open this file ? hosts

Lets go to xampp and start run

and go to folder -> C:\xampp\htdocs\ds-admin-ms

and open terminal and run

php artisan serve

Next go to browser and paste this

Thanks ??
Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
2 years ago

Somebody essentially lend a hand to make significantly posts I would state. This is the very first time I frequented your web page and to this point? I amazed with the analysis you made to make this particular submit extraordinary. Wonderful process!

Would love your thoughts, please comment.x