iisurl-rewritingweb-farm

IIS URL Redirecting to another server for specific subfolder


I am quite new to IIS Web Farms and url rewriting/redirecting.I need my IIS server to redirect an HTTP request to another server if it has some specific subfolder in the url.

I have a domain with domain name; example.com , and it is bound to a Web Application that is running on a machine with IP address 111.111.111.111 .I also have another web application running on a machine with IP address 222.222.222.222. So,what i need is when server receives an HTTP request with a URL that contains a subdirectory named NewApp it shall redirect to the IP address 222.222.222.222.

For example;

If request url is something like example.com/OldApp or example.com then request shall be served by the web application running on machine with IP address 111.111.111.111

if request url starts with example.com/NewApi then request shall be served by the web application running on machine with IP address 222.222.222.222

How can i achieve this by using url rewrite module of IIS?


Solution

  • Instead of using subdirectory, I created subdomain as ; newApi.example.com and set DNS records for it. I didn't go with reverse proxy solution.