20 Set Domain Name For Localhost Windows New

Setting up a custom domain name instead of a localhost will help you when testing of many things such as redirecting a non www to a www website or vice versa or redirecting from http to https before publishing a website to the production hosting environment.
Set domain name for localhost windows. After opening the hosts file that will look as below. Point the custom domain to 127 0 0 1. 3 add lines containing the domain name s and ip address to redirect to.
Similarly you can add your own custom domain name in. Change localhost domain name in windows 10. Open the host s file and write down your favourite domain name.
Configure files to change localhost s domain. Point the custom domain to 127 0 0 1 localhost add virtual hosts in apache server httpd vhosts conf file. See the section in the red box in the image above.
You may only enter 1 name per line. Below is the step by step guide to change localhost to domain name for xampp in a windows computing environment. For this part you need to dig deep into the windows directory and modify the hosts file.
Run the server and test our work.