DWQA QuestionsCategory: PHPHow to create Vhost in window for xampp?
asked 6 years ago

Step1: Go to below  path 


open file : httpd-vhosts.conf

Add :

<VirtualHost *:80>  

ServerName localhots.com  

DocumentRoot “acess_path(C:/xampp/htdocs/..)”  

<Directory “acess_path(C:/xampp/htdocs/..)”>  

Options FollowSymLinks  

AllowOverride All  

Order allow,deny  

Allow from all  




Go to below path :


open this file hosts:  

(prefer opne in notepad ++ to editable)

Entry your host name :      localhots.com

Step3 : 

Restart xampp or wamp 

Thanks 🙂    

1 Answers
kandy Staff answered 6 years ago

Step1 :

You need to have XAMPP installed ( 😐 )

Step2 :

Open up the Xampp control panel and stop Apache (Ensure that you don’t have it running as a service … this is where doing so complicates things)


Navigate to C:/xampp/apache/conf/extra or wherever you installed xampp

Step4  :

Fire up your text editor with administrative privileges and 


Open up httpd-vhosts.conf found in the C:/xampp/apache/conf/extra folder

Step6: At the very bottom of the file paste the following

<VirtualHost *:80>
DocumentRoot “C:/xampp/htdocs/laravel/public”
ServerName localhost.dev
ServerAlias http://www.localhost.dev
<Directory “c:/xampp/htdocs/laravel/public”>
AllowOverride All
Require all Granted

Step6: Go to following path

 C:/Windows/System32/drivers/etc/hosts, where hosts is the file.
 open this file and add following code.             localhost.dev

 Step7 :

 Restart Apache and test to make sure it is working