2012-12-29 63 views
1

我有兩個網站,例如「testsite.ir」和「testsite.com」。因爲我知道我的網站在Windows Server 2008,Microsoft-IIS/7.5上。 我如何使用301重定向將用戶從.ir重定向到.com? 我可以使用.htaccess文件或我應該使用webconfig?301在IIS上重定向?

我使用的代碼波紋管在我的webconfig,但沒有發生:

<rule name="Redirect from ir to com" stopProcessing="true"> 
    <match url=".*" /> 
    <conditions> 
    <add input="{HTTP_HOST}" pattern="^www\.testsite\.ir$" /> 
    </conditions> 
    <action type="Redirect" url="http://www.testsite.com/{R:0}" /> 
    </rule> 

任何幫助,將不勝感激!

回答