1

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?

naltun
  • 114
  • 1
  • 2
  • 12
  • 1
    You can search about redirecting subdomains... maybe these links help: https://forums.iis.net/t/1216172.aspx and https://www.brainarama.com/thought/8af37050-9051-11e7-8efa-871c7c192f33/IIS-7-URL-Rewrite-subdomains-and-host-headers – Dalton Cézane Apr 20 '18 at 05:03
  • 1
    Sadly, I could not make it work with IIS. I have solved this problem by creating subdomains. – naltun Apr 25 '18 at 01:34
  • It is recommended you put your solution as the answer, so other users with same problem can benefit from it. – Dalton Cézane Apr 25 '18 at 01:55

1 Answers1

0

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.

naltun
  • 114
  • 1
  • 2
  • 12