Replacing Localhost to domain name or website name of your choice in Windows is very easy.
Sometimes when you are working on a web project on wamp you want that your site will open in wamp when you type in the domain name of your site instead of typing localhost in the addressbar.
Following are the steps you have to follow for use the domain of your site to run your website on wampserver instead of localhost:
And Open hosts file
Sometimes when you are working on a web project on wamp you want that your site will open in wamp when you type in the domain name of your site instead of typing localhost in the addressbar.
Following are the steps you have to follow for use the domain of your site to run your website on wampserver instead of localhost:
In windows explorer go to this location :
C:\Windows\System32\drivers\etc
And Open hosts file
hosts file as shown in this image |
open the host file in notepad,
Find this line:
Copy this line and paste it again in a new line127.0.0.1 localhost
and replace the word - "localhost" with your own domain as shown in image below :
Save and Close it.
Now run the wampserver
after the wampserver icon turns green i.e. it starts all its services.
Now when you open the browser and enter the domain name you saved in hosts file it will run successfully.