简体   繁体   中英

IIS 8.5 URL ReWrite

I have an asp.net application hosted on two servers.

Server 1 : http(s)://server1.domain.com

Server 2 : http://server2.domain.com

Now i have to write URL Rewrite rule so that all the "HTTP" requests coming to server1 should be redirected to server2 but all the "HTTPS" requests coming to server1 should be handled by server1 it self.

Thanks in advance for the help...

Try using the following url rewrite rule:

<rule name="Redirect to HTTP" stopProcessing="true">
  <match url="https://*.server1.domain.com/(*)" />
  <action type="Redirect" url="http://server2.domain.com/{R:1}" redirectType="SeeOther" />
</rule>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM