How to configure XAMPP to run multiple WordPress websites

Step-by-Step How to configure XAMPP to run multiple WordPress websites in Windows 7/8/10

In this post, we will learn Step-by-Step How to configure XAMPP to run multiple WordPress websites

If you are a WordPress Theme/Plugin Developer or provide Professional WordPress support then at times you must have felt the need to run multiple WordPress websites on the same XAMPP installation in Windows 7/8/10.

How to configure XAMPP to run multiple WordPress websites in Windows 7/8/10

This tutorial is written focusing on you guys in particular who have this technical problem!

What are Virtual Hosts?

When Multiple websites are running on the same Apache web server, they are called Virtual Hosts.

Configuring Virtual Hosts in XAMPP to Run Multiple Websites

In this tutorial we are going to use 2 websites and their local files to explain the procedures.

Step 1: Goto C:\xampp\apache\conf\extra\ and open httpd-vhosts.conf file ( i.e.Virtual Hosts Apache configuration file)

Step 2: Uncomment the below line to enable name based virtual hosts on your XAMPP installation.

[dm_code_snippet background="yes" background-mobile="yes" bg-color="#abb8c3" theme="light" language="html" wrapped="no"]

NameVirtualHosts *:80

[/dm_code_snippet]

Step 3: Now go to the end of the file & add the following 4 lines. These 4 lines allow access to the XAMPP configuration pages (to access phpMyAdmin etc) by using the URL http://localhost

[dm_code_snippet background="yes" background-mobile="yes" bg-color="#abb8c3" theme="light" language="html" wrapped="no"]

<VirtualHost *>

DocumentRoot "C:\XAMPP\htdocs"

ServerName localhost

</VirtualHost>

[/dm_code_snippet]

Step 4: For each multiple virtual hosts (websites) you need to configure the XAMPP Apache web server, add the below code (using www.sarkarijobstoday.com & www.byteswiki.com as example).

[dm_code_snippet background="yes" background-mobile="yes" bg-color="#abb8c3" theme="light" language="html" wrapped="no"]

<VirtualHost *>

DocumentRoot "C:\XAMPP\htdocs\wpsjt"

ServerName www.sarkarijobstoday.com

<Directory "C:\xampp\htdocs\wpsjt">

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

<VirtualHost *>

DocumentRoot "C:\XAMPP\htdocs\wpbytes"

ServerName www.byteswiki.com

<Directory "C:\xampp\htdocs\wpbytes">

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

[/dm_code_snippet]

Step 5: Test the Apache configuration by running the httpd.exe process with the –t switch from the c:\xampp\apache\bin directory as seen in the below screenshot.

Step 6: Goto C:\Windows\System32\drivers\etc\ to configure your Windows Hosts File to redirect the traffic from your computer to the local installation of XAMPP rather than to the original website. Open the file and add the following entry:-

[dm_code_snippet background="yes" background-mobile="yes" bg-color="#abb8c3" theme="light" language="html" wrapped="no"]

127.0.0.1 www.sarkarijobstoday.com

127.0.0.1 www.byteswiki.com

[/dm_code_snippet]

Once you are finished testing then don’t forget to delete the entries from the Windows hosts file to be able to access the live website again.

Good Day!

Also Read

This article first appeared here on: Step-by-Step How to configure XAMPP to run multiple WordPress websites in Windows 7/8/10

BytesWiki.Com