IIS: Is it possible to redirect internally to another port?

I would like to redirect (or rewrite) internally an incoming URL as follows:

https://hostnameA.com => https://hostNameB.com:nnnn/fixedpath

  • hostnameA.com and hostnameB.com point to the same IP address
  • the browser should not see hostnameB in the URL (no browser roundtrip)

Is this possible?

Thanks


It is not possible with URL rewrite alone, you will have to install ARR in order to rewrite to a different domain. This article has some good information about it, including the scenario you are trying to setup. Your rule would look something like this, and needs to be added to the site which hosts hostnameA.com:

<rewrite>
    <rules>
        <rule name="Reverse Proxy to hostnameB" stopProcessing="true">
            <match url="(.*)" />
            <action type="Rewrite" url="https://hostNameB.com:nnnn/fixedpath" />
        </rule>     
    </rules>
</rewrite>