I have a one website application pointing multiple domains.
what i want is, if user visiting domain1.com then they should be redirect to https ://www.domain1.com
and rest all domain pointing same application use without https (eg http ://www.domain2.com / http ://www.domain3.com)
Domain must redirect as below:
Below code to rewrite for other than https domains.
<rule name="domain1" stopProcessing="true">
<match url="^www.domain1.com$" negate="true" />
<action type="Rewrite" url="otherdomain/{R:1}" />
</rule>
Appriciate your help in advance. Thanks
Can you please try below configuration?
<rules>
<rule name="Remove WWW prefix" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.domain1\.com$" />
</conditions>
<action type="Redirect" url="https://www.domain1.com/{R:1}" redirectType="Permanent" />
</rule>
</rules>
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.