i am hosting a couple of websites on different servers and i am using IIS 10 + url rewrite on the frontend server as a reverse proxy only.
the redirection is as follows :
- www.example.com rewrite to server A :
- siteB.example.com rewrite to server B :
- siteC.example.com rewrite to server C :
This scheme allows me to only have one certificate to manage for all my subdomain websites
This is working fine on subdomains with conditions matching rules.
Now i want to do a rewrite rule from a sub directory to map the entire site D to that subdirectory.
example:
- www.example.com/siteD rewrite to server D :
the site redirects the first page but the aspect look weird and links are not functioning.
is it the right way to handle that with conditions {C:2} or should the pattern be applied to the match url ?
here is my web.config :
<rule name="www.example.com_site_d" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{HTTP_HOST}" pattern="^www.example.com$" />
<add input="{REQUEST_URI}" pattern="^(/siteD/)(.*)$" />
</conditions>
<action type="Rewrite" url="http://myinternalsited:80/{C:2}" logRewrittenUrl="true" />
Thanks