手机看片精品高清国产日韩,色先锋资源综合网,国产哺乳奶水91在线播放,乱伦小说亚洲色图欧洲电影

幫助中心 >  技術知識庫 >  云服務器 >  IIS的使用和管理 >  IIS站點上多個域名做不同301跳轉的實現

IIS站點上多個域名做不同301跳轉的實現

2018-04-22 07:11:51 22953

比如我在一臺主機上的IIS站點綁定了兩個域名a.com和b.com,現在都要做301要指向不同網址,那么如何寫web.config呢?代碼如下:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
<rules>
<rule name="301-1" stopProcessing="true">
<match url=".*" />
<conditions>
            <add input="{HTTP_HOST}" pattern="^a.com$" />
</conditions>
<action type="Redirect" url="a.com要跳轉的域名/{R:0}" 
redirectType="Permanent" />
</rule>
<rule name="301-2" stopProcessing="true">
<match url=".*" />
<conditions>
            <add input="{HTTP_HOST}" pattern="^b.com$" />
</conditions>
<action type="Redirect" url="b.com要跳轉的域名/{R:0}" 
redirectType="Permanent" />
</rule>
</rules>
    </rewrite>
 <system.webServer>
 </configuration>


提交成功!非常感謝您的反饋,我們會繼續努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務,我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: