I have 2 servers. At my registrar, the DNS of my domain points to Server1. How can I set up my servers, so that Server1 redirects all Web requests for my domain to Server2.

My goal is that I can change Server2 whenever I want without having to change the DNS at my registrar (and have to wait X hours for the changes to spread). I would simply change something in Server1 so that it redirects to Server3 instead of Server2 and as soon as I would do that, it would work for all visitors.

Does it make sense? How would I set this up? I looked at DNS servers and slaves but I am confused.


You can add the below line to the .htaccess file on server 1 so that it redirects all http requests to server 2.

Redirect 301 / ip-address-of-server-2
|improve this answer|||||
  • Thanks, Webmaster. I am on Windows server. If I do a 301 redirect using the IP address, it looks like the address showing up in the web browser becomes ip-address-of-server-2 and not the domain anymore. Also the domain on server 2 is on a shared IP and the request does not get funneled to the proper domain... – Atchoum Dec 27 '13 at 14:36
  • I found a similar question that may have an answer for you: serverfault.com/questions/47537/…. Also, you may read this article to get specifics for IIS 5 support.microsoft.com/kb/313074 – Rana Prathap Dec 27 '13 at 16:33
  • Thanks, Webmaster. Indeed I believe what I am looking for is a reverse proxy. Thanks! – Atchoum Dec 30 '13 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.