【发布时间】:2018-06-30 18:26:16
【问题描述】:
对此很陌生,但很难理解。
我能够将非 www 重定向到 www,将 http 重定向到 https,但现在我需要将域指针重定向到主节点。即 Domain2.com 到 Domain1.com。我担心 URL 链并在 SEO 上受到打击。我应该把域重定向放在 WWW\https 之前吗?
<rule name="Force WWW and SSL" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^[^www]" />
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://www.domain1.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
<!-- Just add this? Should it go in front of the other? -->
<rule name ="Redirect Domain2 to Domain1" enabled="true">
<match url="(.*)" ignoreCase="true" />
<conditions>
<add input="{HTTP_HOST}" pattern="domain2.com" />
</conditions>
<action type="Redirect" url="https//www.domain1.com/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
【问题讨论】:
标签: asp.net https url-rewriting url-redirection