Subscribe Us

header ads

How to add a custom domain name on your localhost using XAMPP on Windows

How to add a custom domain name on your localhost using XAMPP on Windows



Step 1 Open Notepad as an Administrator 

Click on file and open then navigate to

C:\Windows\System32\drivers\etc

Open hosts file

Add the below line and save the file.

127.0.0.1 mydomain.com

Step 2 Edit httpd-vhosts.conf file

 (In my system D:\xampp\apache\conf\extra and edit httpd-vhosts.conf )

Add the custom domain name below lines and save the file

<VirtualHost *:80>
 ServerName www.mydomain.com
 ServerAlias mydomaim.com
 DocumentRoot "D:/xampp/htdocs/mydomain.com"
<Directory "D:/xampp/htdocs/mydomain.com">
Allow from all
Require all granted
</Directory>
</VirtualHost>


Post a Comment

0 Comments