I will soon be moving my website to a new server. Before going live, I want to test all the new functionality. I have uploaded all the files to the new server, and now I want to ‘fake’ the domain, i.e. by typing in my domain name, which is linked to the old server, I want to be forwarded the the new server (just for me, that is. All other visitors should still see the old server).
I was hoping to achieve this by putting my domain name and the IP of the new server in my local hostfile, but this doesn’t seem to work.
Any ideas on how to accomplish this?
This is the correct approach.
Assuming you are under windows, the host file is usually located at: C:\Windows\System32\drivers\etc\hosts
Add a line like:
Note that http://www.yourdomain.com is different from yourdomain.com
Save, and check you are getting the correct resolution by pinging the IP in a command windows. Start > Run > “cmd” then
ping www.yourdomain.comAssuming this returns the correct result, try the browser, if this does not work then the browser is caching the previous DNS entry and you may want to try a different browser or restart the browser and/or machine.