[英]URL Rewriting - how to configure multiple domain on same website with http and https
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 我想要的是,如果用户访问domain1.com,则应将其重定向到https://www.domain1.com
and rest all domain pointing same application use without https (eg http ://www.domain2.com / http ://www.domain3.com) 并保留所有指向同一应用程序且不使用https的域(例如http://www.domain2.com / http://www.domain3.com )
Domain must redirect as below: 域必须重定向如下:
Below code to rewrite for other than https domains. 下面的代码可为https域以外的域重写。
<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.