D6 Digital
Published in

D6 Digital

Create Virtual host for Apache on Windows 10 by Using XAMPP.

Nowadays many developers, small businesses, and even large businesses rely on Apache to power their website on a daily basis. Apache was mainly designed to run on linux servers, but has since been ported to run on any operating system.So here we can use apache on windows operating system too.

In this blog, I am going to explain how you can setup and configure virtual hosts for drupal website with XAMPP running on windows 10.


First, you have to stop apache server in XAMPP control panel.


Then,you need to go C:\xampp\apache\conf\extra

Then,edit httpd-vhosts.conf with text editor. Here i edit with notepad++


After editing with text editor you will see like this.


Then uncomment the NameVirtualHost *:80 ,


Then, go to the down of the page and copy following code and paste it.


<VirtualHost *:80>
DocumentRoot “C:\xampp\htdocs\D6-Technology”
ServerName www.d6technology.lk
<Directory “C:\xampp\htdocs\D6-Technology”>
Require all granted

DocumentRoot: The folder where files of a site will exist. in this case my drupal site folder name is D6-technology.

ServerName: This is the URL for our virtual host.i am using my url as www.d6technology.lk

Directory: This is the directory of our virtual host.

Then save that folder…


Then you need to go C:\Windows\System32\drivers\etc , It look something like this.

Then edit the hosts file in your text editor.it look like this.

At the bottom of the file just type, [ServerName]

Ex: here i am using my server name as www.d6technology.lk www.d6technology.lk

Then save hosts file.

Note FOR Drupal Virtual Host:

C:\xampp\htdocs\D6-Technology\sites\default go to this path in your drupal site ,check whether there is a setting.php file.if it is you have to change like this.

In the bottom of the folder you have to add this code => ‘^www\.example\.com$’, →server name

Ex: ‘^www\.d6technology\.lk$’,

Important: Then go to the Xampp control panel and start apache server.


Once you are done, check whether by browsing your servername URL(www.d6technology.lk)




D6 Digital provides total business solutions to improve efficiency and productivity of your business processes using a combination of existing technology and innovative methods.

Recommended from Medium

AspenLabs - A platform to discover and innovate

Guide on how to apply for participation in the Incentivized Quantum Community Ambassador Program…

Performance Testing - What to consider…

MultiColor For Text In Swift

Get Azure DevOps Sprint Capacity Using API and PostMan

Flex-y Grids

Python or Julia? What’s Your Best Bet for Data Science

How Square writes commit messages

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ahmed Thaajwer

Ahmed Thaajwer

B.Sc.(hons) in Computing & Information System(SUSL). Former Software Engineer@D6 Digital. IEEE Brand Ambassador@IEEE. Regional Country Director@UYG.

More from Medium

Everything , Everywhere

Remote MySQL Database setup for Magento2 domain

Laravel Development Services And eCommerce Daily Deals

Simple Bot To Book your Practical Driving Test