[RESOLVED] redirecting web traffic via host file
I have been given a job to do some testing on a product update that is set to go out.
The issue at hand is that the existing product is live, and they would like me to do some testing of the update process on it. Obviously we can't do testing on the live server, because that would push updates out to users, and the update is not approved yet for release.
I have a local web server that has an exact mirror of the live web server. My goal here is to redirect requests for the live server with my local server. Since I can't do this in the source code (URLs are hard coded, and they want testing done on the live production code) I figured a simple solution could be to edit the host file on the testing boxes to redirect requests for the live site's IP to the testing one. The program should never know the difference, and would allow me to carry out the needed tests.
My issue is that it doesn't seem to work. I am not a DNS/networking expert, so I am not sure if I have taken all needed steps. This is basically what I did:
1) pinged live website URL to get its IP
2) put IP in host file, redirected to machine name where local IIS mirror is (just how the default mapping line of 127.0.0.1 to localhost looks, ie 'IP{space}machine name')
3) rebooted
so the line in the HOST file looks like this
XX.XXX.XX.XX LocalIISMachineName
however redirect's don't occur, and pinging the original DNS name still returns the IP of the live server, not the local one.
Is there anything else I can try here?
Re: redirecting web traffic via host file
I resolved this.
I sort of had it backwards. I was putting the IP of the live server in the host file, and then putting the machine name I wanted it to redirect to. However I really needed to put the IP of the local server I wanted to redirect to, and put the domain name of the live site next to that.