ASP.Net:301重定向
我有下面的代码重定向,但它似乎没有很好的工作ASP.Net:301重定向,asp.net,iis,web-config,Asp.net,Iis,Web Config,我有下面的代码重定向,但它似乎没有很好的工作 <configuration> <location path="article.aspx"> <system.webServer> <httpRedirect enabled="true" destination="http://www.newsite.co.uk/new-page-a/" httpResponseStatus="Permanent" />
<configuration>
<location path="article.aspx">
<system.webServer>
<httpRedirect enabled="true" destination="http://www.newsite.co.uk/new-page-a/" httpResponseStatus="Permanent" />
</system.webServer>
</location>
<location path="old-page-2.html">
<system.webServer>
<httpRedirect enabled="true" destination="http://www.newsite.co.uk/new-page-b/" httpResponseStatus="Permanent" />
</system.webServer>
</location>
<system.webServer>
<httpRedirect enabled="true" exactDestination="true" destination="http://www.newsite.co.uk/" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>
我不确定这里出了什么问题。任何帮助如果可能,放弃这种方法,改为编写一些URL重写规则。这将更便于维护和扩展。@LexLi该网站已经上线,并且已经被谷歌编入索引,因此这样做是为了确保谷歌理解我们没有重复的内容,但已经移动了codebaseURL重写提供了同等的功能,但一般说来更易于配置(取决于您对正则表达式等的熟悉程度)。首先尝试一下,您会发现您当前的配置(依赖于位置标记)不够灵活。