How to Change Domain Name on XAMPP From localhost or 127.0.0.1 to yourdomain.com

Untitled Document.md
  1. goto C:/xampp/apache/conf/extra/ than open httpd-vhosts.conf with code editor example VS Code than you will see
##<VirtualHost *:80>
    ##ServerAdmin [email protected]
    ##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
    ##ServerName dummy-host.example.com
    ##ServerAlias www.dummy-host.example.com
    ##ErrorLog "logs/dummy-host.example.com-error.log"
    ##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost>

##<VirtualHost *:80>
    ##ServerAdmin [email protected]
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
    ##ServerName dummy-host2.example.com
    ##ErrorLog "logs/dummy-host2.example.com-error.log"
    ##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>
  1. than Remove the command ## like also remove
##ServerAdmin [email protected]
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
  1. Replace your Project Directory of DocumentRoot and Name your Favorite Domain that you Love
<VirtualHost *:80>
    DocumentRoot "D:/Project"
    ServerName task.com
</VirtualHost>
  1. also you can create multiple Domain Name by Create multiple VirtualHost like:
<VirtualHost *:80>
    DocumentRoot "D:/Project"
    ServerName task.com
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "D:/Project/Website"
    ServerName web.com
</VirtualHost>
  1. after done Restart the XAMPP server than goto your local domain task.com or web.com

How to Change Virtual Host go to https://sophatleat.blogspot.com/2021/12/how-to-change-virtual-host-and-how-to.html

if you like this turtorial just Leave a Comment :) Thanks

បង្ហាញមតិយោបល់

អត្ថបទមុន អត្ថបទបន្ទាប់