Hi all,
I have a single IIS 7 site, responsible for three different domains. Each domain needs to point to a different directory. Also, I would like to automatically redirect the the "
https://www" root for any requests that come in.
Domains and Mappings:
1) domain1.com ->
https://www.domain1.com/sub1/
2) domain2.com ->
https://www.domain2.com/sub1/domain2.aspx
3) domain3.com ->
https://www.domain3.com/sub1/domain3.aspx
Can anyone assist me? I'm trying to get URL re-writing to work, but have been unsuccessful so far. Maybe there is a better alternative?
please check the below script use to rewrite the http request to https using the MS URL rewrite
You can place it under the web.config
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>