2013-04-24 57 views
1

我們有一個簡單的HTML asp.net網站託管在Azure上,當我們複製粘貼子頁面URL(無WWW)時,我們面臨重定向問題瀏覽器。 例子:www.example.com/subpage.aspx工作正常,但在複製粘貼example.com/subpage.aspx它重定向到www.example.comsubpage.aspx /(老實說不知道哪裏&它是如何發生的)Canonical Rewrite for subfages not working using the rewrite rules in web.config

下面的代碼寫在活的web.config文件,(除確切域名)

<rewrite> 
     <rules> 
      <rule name="RedirectToWWW" stopProcessing="false"> 
       <match url=".*" /> 
       <conditions> 
        <add input="{HTTP_HOST}" pattern="^example\.com$" /> 
       </conditions> 
       <action type="Redirect" url="http://www.example.com/{R:0}" /> 
      </rule> 
     </rules> 
    </rewrite> 

是新來的這個項目,等等我應該從哪裏開始我的調查和我應該在哪裏給予任何指導修復將是非常有幫助的。

+1

user2314155 2013-04-24 06:26:36

回答

0

更改爲:

<action type="Redirect" url="http://www.eyeswidewhat.net/{R:1}" /> 

此外,設置stopProccessingtrue