301 Redirect one domain to another using web.config

喜夏-厌秋 提交于 2019-11-30 06:27:05
Claus

This is not really that umbraco related but I think what you want to do is this:

<rewrite>
  <rules>
    <rule name="redirect" enabled="true">
      <match url="(.*)" />
        <conditions>
          <add input="{HTTP_HOST}" negate="true" pattern="^www\.example\.com$" />
        </conditions>
      <action type="Redirect" url="http://www.example.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
    </rule>
  </rules>
</rewrite>

Match all urls unless the host name part is exactly www.example.com - and redirect those to www.example.com/whatever.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!