[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

URL Rewrite in IIS not working as desired....

Hi there...
We are moving IIS webservers and sql servers....

In order to avoid the client updating the A-record at stupid-o-clock we wanted to redirect users to the new webserver automatically and seamlessly..

Currently  https://test.com points to   on webserver A.

we have a new webserver B with an instance of  test.com running

On webserver A I created a IIS reverse proxy rewrite rule to redirect to  inbound and outbound.

It seemed to work, but then realised parts were not being redirected.  It seemed to be using the web.config file on server A but using content from server B.

Because the web.config file was in use the old sql server on A was being used and not the new one on B.

How can I redirect all requests to the site to B and then replies back to A.

I basically want a seamless experience - forwarding everything on to the new webserver not using the web.config on the old server.................... and defintly not the old sql server.

I cant configure routing policies at a firewall level as we don't have access to the router its a shared office etc.
  • 2
1 Solution
Dan McFaddenSystems EngineerCommented:
Using a reverse proxy may not be the best way to implement the migration to a new web server.

The reverse proxy process is just pulling the content from Webserver B thru Webserver A.  In this scenario A is functioning using its config then hitting B which is using its own config.  Therefore Webserver A is nothing more than a client to Webserver B... A is doing a HttpRequest from B, B processes the request, returns it to A and A forwards it on to the original requester.

Assuming that the site content is the same, I would use a HTTP redirect.

link:  http://technet.microsoft.com/en-us/library/cc732969(v=ws.10).aspx

Or using a little coding, you could also create a blank site under the old location (Webserver A on and configure the 404 error page to detect the inbound request and then do a redirect to the same location but on the new server.  This is the method that I've used in similar scenarios.

Some links:

custom pages 404 redirect & error display:  http://forums.iis.net/t/1195922.aspx?custom+pages+404+redirect+and+error+display

Create a Custom HTTP Error Response (IIS 7): http://technet.microsoft.com/en-us/library/cc753103(v=ws.10).aspx

Dan McFaddenSystems EngineerCommented:
Any update?
Spikeuk30Author Commented:
Thanks Dan.  

I managed to get the redirecting working in the end to an extent.

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now