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

1 ezpz Oral Development Tools (3 Pack in Sage) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies

ezpz Oral Development Tools (3 Pack in Sage) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies

  • EXPERT-DESIGNED TOOLS AID IN ESSENTIAL FEEDING AND SPEECH SKILLS.
  • SAFE, FOOD-GRADE SILICONE PROTECTS TINY GUMS AND DEVELOPING TEETH.
  • PERFECT FOR AGES 3+ MONTHS, EASY TO CLEAN AND USE FOR PARENTS.
BUY & SAVE
$16.99
ezpz Oral Development Tools (3 Pack in Sage) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies
2 ezpz Oral Development Tools (3 Pack in Blush) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies

ezpz Oral Development Tools (3 Pack in Blush) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies

  • EXPERT-DESIGNED TOOLS ENSURE SAFE FEEDING AND SPEECH SKILL DEVELOPMENT.

  • MADE FROM SOFT, FOOD-GRADE SILICONE FOR SAFE MUNCHING AND CHEWING.

  • DISHWASHER SAFE FOR EASY CLEANING, STARTING AT 3+ MONTHS OLD.

BUY & SAVE
$16.99
ezpz Oral Development Tools (3 Pack in Blush) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies
3 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
4 ezpz Oral Development Tools (3 Pack in Pewter) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies

ezpz Oral Development Tools (3 Pack in Pewter) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies

  • BOOST FEEDING SKILLS SAFELY WITH PEDIATRICIAN-DESIGNED TOOLS.
  • SOFT, FOOD-GRADE SILICONE ENSURES SAFE EXPLORATION FOR TINY MOUTHS.
  • DISHWASHER SAFE FOR EASY CLEANUP-MAKING MEALTIME EFFORTLESS!
BUY & SAVE
$16.99
ezpz Oral Development Tools (3 Pack in Pewter) - 3 Months+ - Non-Slip Loop, Smile and Stick 100% Silicone Tools - Prepare for Chewing + Solids - Baby-Led Weaning Supplies
5 hand2mind Phoneme Phone, Speech Therapy Toys, Autism Learning Materials, Toddler Speech Development Toys, Dyslexia Tools for Kids, Phonemic Awareness, ESL Teaching Materials, Reading Phones

hand2mind Phoneme Phone, Speech Therapy Toys, Autism Learning Materials, Toddler Speech Development Toys, Dyslexia Tools for Kids, Phonemic Awareness, ESL Teaching Materials, Reading Phones

  • ELEVATE ESL LEARNING WITH AMPLIFIED PHONEMIC AWARENESS TOOLS!

  • ENHANCE SPEECH THERAPY THROUGH FUN, INTERACTIVE PHONEME PHONES!

  • PERFECT FOR HOMESCHOOLING: BOOST LITERACY WITH ENGAGING ACTIVITIES!

BUY & SAVE
$7.99 $13.99
Save 43%
hand2mind Phoneme Phone, Speech Therapy Toys, Autism Learning Materials, Toddler Speech Development Toys, Dyslexia Tools for Kids, Phonemic Awareness, ESL Teaching Materials, Reading Phones
6 3-Pack Toddler Safety Scissors Kit - Child-Safe Preschool Training Scissors & 60 Sheets Craft Paper | Ergonomic Blunt Tips, Early Childhood Development Tools for Kids 2-5 Years

3-Pack Toddler Safety Scissors Kit - Child-Safe Preschool Training Scissors & 60 Sheets Craft Paper | Ergonomic Blunt Tips, Early Childhood Development Tools for Kids 2-5 Years

  • CHILD-SAFE DESIGN: BLUNT TIPS AND SAFE BLADES PREVENT CUTS.
  • CREATIVE FUN: 60 ACTIVITY SHEETS TO BOOST FINE MOTOR SKILLS.
  • VIBRANT COLORS: COMES IN THREE SHINY COLORS FOR ADDED EXCITEMENT!
BUY & SAVE
$8.99
3-Pack Toddler Safety Scissors Kit - Child-Safe Preschool Training Scissors & 60 Sheets Craft Paper | Ergonomic Blunt Tips, Early Childhood Development Tools for Kids 2-5 Years
7 Character Keeper: A character development workbook for writers and creatives (Author Journal) - Black

Character Keeper: A character development workbook for writers and creatives (Author Journal) - Black

BUY & SAVE
$11.99
Character Keeper: A character development workbook for writers and creatives (Author Journal) - Black
8 LOVESTOWN Kids Safety Scissors, 4 PCS Blunt Tip Scissor Preschool Training Stocking Stuffer for Toddler, Anti-Pinch Design, Child Hand Eye Coordination Development, Playdough Tools Scrapbooking

LOVESTOWN Kids Safety Scissors, 4 PCS Blunt Tip Scissor Preschool Training Stocking Stuffer for Toddler, Anti-Pinch Design, Child Hand Eye Coordination Development, Playdough Tools Scrapbooking

  • COLORFUL & FUN: VIBRANT DUAL-COLOR SCISSORS ENGAGE KIDS’ CREATIVITY!

  • SAFE DESIGN: ROUNDED BLADES ENSURE FUN WITHOUT THE RISK OF INJURY.

  • ERGONOMIC COMFORT: EASY FOR LITTLE HANDS, PERFECT FOR LEFT OR RIGHT USERS!

BUY & SAVE
$5.99
LOVESTOWN Kids Safety Scissors, 4 PCS Blunt Tip Scissor Preschool Training Stocking Stuffer for Toddler, Anti-Pinch Design, Child Hand Eye Coordination Development, Playdough Tools Scrapbooking
9 The Consultant's Big Book of Organization Development Tools : 50 Reproducible Intervention Tools to Help Solve Your Clients' Problems

The Consultant's Big Book of Organization Development Tools : 50 Reproducible Intervention Tools to Help Solve Your Clients' Problems

BUY & SAVE
$16.94 $39.00
Save 57%
The Consultant's Big Book of Organization Development Tools : 50 Reproducible Intervention Tools to Help Solve Your Clients' Problems
+
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.