Skip to main content
PHP Blog

Back to all posts

How to Create A Subdomain In Localhost Xampp?

Published on
5 min read
How to Create A Subdomain In Localhost Xampp? image

Best Tools for Local Development to Buy in September 2026

1 The Leadership Development Tool Kit: Redesigning Your Leadership Development Template to Drive Individual and Organizational Change

The Leadership Development Tool Kit: Redesigning Your Leadership Development Template to Drive Individual and Organizational Change

BUY & SAVE
$14.97
The Leadership Development Tool Kit: Redesigning Your Leadership Development Template to Drive Individual and Organizational Change
2 ezpz Oral Development Tools (3 Pack in Blush) - 3 Months+ - 100% Silicone

ezpz Oral Development Tools (3 Pack in Blush) - 3 Months+ - 100% Silicone

  • PROMOTE SENSORIMOTOR SKILLS FOR SAFE FEEDING AND SPEECH DEVELOPMENT.
  • PEDIATRIC EXPERT-DESIGNED TOOLS ENSURE EFFECTIVE MILESTONE SUPPORT.
  • SAFE, HIGH-QUALITY SILICONE FOR GENTLE USE WITH DEVELOPING GUMS.
BUY & SAVE
$16.99
ezpz Oral Development Tools (3 Pack in Blush) - 3 Months+ - 100% Silicone
3 auby Busy Board 3.0 Detachable & Assemblable Toy for Toddlers 1+

auby Busy Board 3.0 Detachable & Assemblable Toy for Toddlers 1+

  • TRAVEL-FRIENDLY DESIGN: DETACHABLE MODULES FOR ON-THE-GO FUN!

  • STIMULATES LEARNING: ENGAGING ACTIVITIES BOOST COGNITIVE SKILLS IN KIDS.

  • DURABLE & SAFE: CHILD-SAFE MATERIALS ENSURE HOURS OF SECURE PLAY.

BUY & SAVE
$39.99
auby Busy Board 3.0 Detachable & Assemblable Toy for Toddlers 1+
4 Learning Resources New Sprouts Fix It! My Very Own Tool Set - 6 Pieces, Ages 2+ Toddler Learning Toys, Develops Fine Motor Skills, Toddler Tool Set, First Tool Box, Kids Tool Set,Stocking Stuffers

Learning Resources New Sprouts Fix It! My Very Own Tool Set - 6 Pieces, Ages 2+ Toddler Learning Toys, Develops Fine Motor Skills, Toddler Tool Set, First Tool Box, Kids Tool Set,Stocking Stuffers

  • SAFE, DURABLE TOOLS FOR IMAGINATIVE PLAY AND CREATIVITY.
  • REALISTIC SOUNDS ENGAGE KIDS AND ENHANCE PLAYTIME FUN.
  • PERFECT GIFT FOR HOLIDAYS, BIRTHDAYS, OR JUST-BECAUSE SURPRISES!
BUY & SAVE
$23.99
Learning Resources New Sprouts Fix It! My Very Own Tool Set - 6 Pieces, Ages 2+ Toddler Learning Toys, Develops Fine Motor Skills, Toddler Tool Set, First Tool Box, Kids Tool Set,Stocking Stuffers
5 Memory Development Tools: How to Improving Your Memory. Get Mental Toughness to Achieve Your Life Goals

Memory Development Tools: How to Improving Your Memory. Get Mental Toughness to Achieve Your Life Goals

BUY & SAVE
$4.99
Memory Development Tools: How to Improving Your Memory. Get Mental Toughness to Achieve Your Life Goals
6 DIMROM Clay and Play Dough Tools Nine Piece Set - Ages 3 & Up (9pcs)

DIMROM Clay and Play Dough Tools Nine Piece Set - Ages 3 & Up (9pcs)

  • BOOST CREATIVITY: 9 VERSATILE TOOLS FOR ENDLESS SHAPING FUN!
  • DURABLE DESIGN: MADE TO LAST FOR HOME AND CLASSROOM ADVENTURES!
  • SAFE PLAYTIME: NON-TOXIC MATERIALS FOR WORRY-FREE CREATIVITY!
BUY & SAVE
$8.97 $9.97
Save 10%
DIMROM Clay and Play Dough Tools Nine Piece Set - Ages 3 & Up (9pcs)
7 3 Pack Telescoping Magnet Pick-up Tool Set - Retrieving Telescoping Magnet Pickup Tools,Extendable Magnetic Pick Up Tools,Bendable Spring Magnet Stick

3 Pack Telescoping Magnet Pick-up Tool Set - Retrieving Telescoping Magnet Pickup Tools,Extendable Magnetic Pick Up Tools,Bendable Spring Magnet Stick

  • VERSATILE TOOLS: 3 MAGNETIC PICKUPS FOR ALL METAL RETRIEVAL NEEDS!
  • STRONG MAGNETS: LIFT UP TO 15 LBS WITH EASY POCKET-CARRY DESIGN!
  • REACH EVERY CORNER: FLEXIBLE STICK ACCESSES TIGHT SPACES EASILY!
BUY & SAVE
$8.99
3 Pack Telescoping Magnet Pick-up Tool Set - Retrieving Telescoping Magnet Pickup Tools,Extendable Magnetic Pick Up Tools,Bendable Spring Magnet Stick
8 JJC 35mm Film Cassette Opener with Soft Silicone Grip, Premium Metal 120 135 Film Cartridge Removal Darkroom Tool, Essentials of Film Developing Kit & Processing Equipment - Black

JJC 35mm Film Cassette Opener with Soft Silicone Grip, Premium Metal 120 135 Film Cartridge Removal Darkroom Tool, Essentials of Film Developing Kit & Processing Equipment - Black

  • QUICKLY OPENS 35MM FILM CASSETTES WITH MINIMAL EFFORT!
  • COMFORTABLE NON-SLIP GRIP FOR EASY HANDLING AND CONTROL!
  • DURABLE METAL DESIGN ENSURES LONG-LASTING RELIABILITY!
BUY & SAVE
$8.29 $8.99
Save 8%
JJC 35mm Film Cassette Opener with Soft Silicone Grip, Premium Metal 120 135 Film Cartridge Removal Darkroom Tool, Essentials of Film Developing Kit & Processing Equipment - Black
9 eTone 35mm Film Cassette Cartridge Opener Removal Darkroom Tool Bulk Film Reload Retriever (Black)

eTone 35mm Film Cassette Cartridge Opener Removal Darkroom Tool Bulk Film Reload Retriever (Black)

  • ERGONOMIC DESIGN ENSURES A COMFORTABLE, FATIGUE-FREE GRIP FOR USERS.
  • SLEEK AND STYLISH, PERFECT FOR ANY MODERN OR RETRO PHOTOGRAPHY SETUP.
  • EFFORTLESS LEVER-ACTION OPENS FILM CASSETTES QUICKLY AND EASILY.
BUY & SAVE
$8.54
eTone 35mm Film Cassette Cartridge Opener Removal Darkroom Tool Bulk Film Reload Retriever (Black)
+
ONE MORE?

To create a subdomain in localhost XAMPP, you can start by opening the XAMPP control panel and making sure that Apache and MySQL services are running. Next, navigate to the "httpd-vhosts.conf" file located in the XAMPP installation directory. Open the file in a text editor and add a new VirtualHost block for your subdomain. Make sure to specify the subdomain name, document root, and other necessary configurations within the VirtualHost block. Save the changes and then edit the system hosts file to map the subdomain to the localhost IP address. Finally, restart the Apache server for the changes to take effect. You should now be able to access your subdomain in localhost XAMPP by entering the specified subdomain URL in your web browser.

How to create a subdomain for a specific project in xampp?

To create a subdomain for a specific project in XAMPP, you will need to follow these steps:

  1. Edit the hosts file:
  • Open the hosts file located at C:\Windows\System32\drivers\etc\hosts on Windows or /etc/hosts on Linux.
  • Add a new line at the end of the file in the following format: 127.0.0.1 subdomain.yourdomain.local, replacing subdomain with the desired subdomain and yourdomain with your actual domain name.
  1. Configure Apache virtual hosts:
  • Navigate to the Apache configuration directory, usually located at C:\xampp\apache\conf\extra\.
  • Open the httpd-vhosts.conf file in a text editor.
  • Add a new virtual host configuration block at the end of the file with the following content:

<VirtualHost *:80> ServerAdmin webmaster@subdomain.yourdomain.local DocumentRoot "C:/xampp/htdocs/yourprojectfolder" ServerName subdomain.yourdomain.local ErrorLog "logs/subdomain.yourdomain.local-error_log" CustomLog "logs/subdomain.yourdomain.local-access_log" common

  • Replace subdomain.yourdomain.local with your subdomain and domain name, and C:/xampp/htdocs/yourprojectfolder with the path to your project folder.
  1. Restart Apache:
  • Open the XAMPP Control Panel.
  • Stop Apache and then start it again to apply the changes.
  1. Access your project:
  • Open a web browser and navigate to http://subdomain.yourdomain.local to access your project via the newly created subdomain.

By following these steps, you should now have a subdomain set up for your specific project in XAMPP.

How to create a wildcard subdomain in localhost xampp?

To create a wildcard subdomain in localhost XAMPP, you can follow these steps:

  1. Open the XAMPP control panel and make sure that Apache server is running.
  2. Navigate to the Apache configuration directory, which is typically located at "C:\xampp\apache\conf\extra".
  3. Open the "httpd-vhosts.conf" file in a text editor.
  4. Add the following code snippet to the file to create a wildcard subdomain:

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "C:/xampp/htdocs" ServerName localhost ServerAlias *.localhost <Directory "C:/xampp/htdocs"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted

  1. Save the file and close the text editor.
  2. Restart the Apache server in the XAMPP control panel.
  3. Now, you can access any subdomain with the format "subdomain.localhost" in your web browser. For example, if you want to create a subdomain called "test", you can access it by entering "test.localhost" in the address bar.

By following these steps, you can create a wildcard subdomain in localhost XAMPP for testing your websites and applications.

How to redirect a subdomain to another page in xampp?

  1. Open the XAMPP control panel and start Apache if it is not already running.
  2. Navigate to the xampp/htdocs directory in the XAMPP installation folder.
  3. Create a new folder for the subdomain you want to redirect. For example, if you want to redirect subdomain.example.com, create a folder named subdomain.
  4. Create an index.php file inside the subdomain folder with the following code:

Replace http://example.com/newpage with the URL of the page where you want to redirect the subdomain.

  1. Save the index.php file and close the text editor.
  2. Open your XAMPP installation folder and navigate to the apache\conf\extra directory.
  3. Open the httpd-vhosts.conf file in a text editor.
  4. Add the following lines at the end of the file:

<VirtualHost *:80> ServerName subdomain.example.com DocumentRoot "C:/xampp/htdocs/subdomain"

Replace subdomain.example.com with the subdomain you want to redirect and C:/xampp/htdocs/subdomain with the path to the folder where you created the index.php file.

  1. Save the httpd-vhosts.conf file and close the text editor.
  2. Restart Apache in the XAMPP control panel to apply the changes.

Now, when you access subdomain.example.com in your web browser, it should redirect to the specified page.

How to access the subdomain control panel in xampp?

To access the subdomain control panel in XAMPP, you need to follow these steps:

  1. Open your web browser and type in the following URL: http://localhost/dashboard/
  2. This will take you to the XAMPP Dashboard where you can see a list of all the installed applications.
  3. Look for the subdomain control panel application, which will typically be listed as "phpMyAdmin" or "Webalizer" depending on the version of XAMPP you are using.
  4. Click on the subdomain control panel application link to access the control panel.
  5. Once you are in the control panel, you can manage your subdomains by creating, configuring, or deleting them as necessary.
  6. Remember to always secure your subdomains by setting appropriate permissions and adding any necessary security measures to prevent unauthorized access.

What is the purpose of creating a subdomain in localhost xampp?

Creating a subdomain in localhost XAMPP allows you to organize your projects and websites in a more systematic way. It can also be useful for testing multiple websites on the same localhost server without conflicts. Additionally, it mimics the structure of live websites with subdomains and can help in developing and testing websites before deploying them to a live server.