How to change localhost to domain name in xampp
Change localhost to domain name in xampp
Step 1. Amend hosts file in windows
Open the hosts file located in folder at C:\Windows\System32\drivers\etc and right click hosts file and select edit “as Administrator” . Now add these line of codes in it and save the file –
( Replace www.yourdomainname.com with your required domain name )
Step 2. Edit httpd-vhosts.conf file in XAMPP installation.
Step 3. If you want to access your site over https edit httpd-vhosts.conf file
You can find this file in this folder here -> ( F:\xampp\apache\conf\extra ).
To make a site to load over https you need to add below line to httpd-vhosts.conf
Note: Add proper ssl certificates to make it secure
Step 3. Now restart XAMPP and check the setup.
Now test it by visiting www.yourdomainname.com domain you set up. If you followed the steps carefully, you should be able to see the content of the site in your browser.