XAMP Change Localhost To Domain

Follow the below steps to Change localhost to custom domain name in XAMP server

1) Open the file C:\Windows\System32\drivers\etc and edit “as Administrator” => hosts file.

Add the below line and save the file.

127.0.0.1 phpcodez.com

2) Edit httpd-vhosts.conf file (In my system E:\xampp\apache\conf\extra and edit httpd-vhosts.conf )

Add the below lines and save the file

<VirtualHost *:80>
 ServerName www.phpcodez.com
 ServerAlias phpcodez.com
 DocumentRoot e:/xampp/htdocs/phpcodez
</VirtualHost>

3) Restart XAMPP and url www.phpcodez.com will load content form e:/xampp/htdocs/phpcodez

4 thoughts on “XAMP Change Localhost To Domain”

Leave a Reply

Your email address will not be published. Required fields are marked *