how to create virtual host on XAMPP - in 3 simple steps
Shahroz Javed
Aug 05, 2023 . 97 views

Table Of Contents


Creating a virtual host in XAMPP involves configuring your local development environment to recognize a custom domain name and route requests to a specific directory on your computer. This is useful for developing and testing web applications locally with a specific domain name. Here's how you can create a virtual host in XAMPP:


01: Edit the Hosts File: myapp.local

02: Configure Apache Virtual Host:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/myapp"
    ServerName myapp.local
    <Directory "C:\xampp\htdocs\myapp">

Replace "C:/xampp/htdocs/myapp" with the actual path to your project's directory.

03: Restart Apache:

04: Access Your Virtual Host:


Your virtual host should now be accessible using the specified domain name (`myapp.local`) in your web browser. This allows you to work on your web application using a custom domain name in your local development environment.


Related Posts

Similar Posts