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

Share & Spread the Knowledge

In this post, we will learn 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 1

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

This tutorial is written focusing on you guys in particular!

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.

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

					

 

<VirtualHost *>
DocumentRoot “C:\XAMPP\htdocs”
ServerName localhost
</VirtualHost>

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).

					

 

<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>


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.

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

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:-

					

 

127.0.0.1 www.sarkarijobstoday.com

127.0.0.1 www.byteswiki.com

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


Share & Spread the Knowledge

Vishnu M William

A Tech Aficionado turned Banker who digs into the latest technology trends and loves to write about it. P.S My love for delicious food is over 9000. #DBZ

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *