[英]URL Rewriting - how to configure multiple domain on same website with http and https
我有一个指向多个域的网站应用程序。
我想要的是,如果用户访问domain1.com,则应将其重定向到https://www.domain1.com
并保留所有指向同一应用程序且不使用https的域(例如http://www.domain2.com / http://www.domain3.com )
域必须重定向如下:
下面的代码可为https域以外的域重写。
<rule name="domain1" stopProcessing="true">
<match url="^www.domain1.com$" negate="true" />
<action type="Rewrite" url="otherdomain/{R:1}" />
</rule>
提前申请您的帮助。 谢谢
您可以尝试以下配置吗?
<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.