2013-04-24 58 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