我有一个Umbraco CMS,它托管了2个不同域名的网站。我需要使用web.config中的iis重写为每个执行规范重定向。
示例:mydomain1.com - > www.mydomain1.com和mydomain2.com - > www.mydomain2.com。
我正试图让它工作,但它无法正常工作 根本没有重定向,有时它会重定向到另一个域。
<rewrite>
<rules>
<rule name="RedirectToWWW" enabled="false" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\S+)\.com$" />
</conditions>
<action type="Redirect" url="http://www.{C:0}/{R:0}" />
</rule>
</rules>
</rewrite>
在共享托管环境中有更好的方法吗?