Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.Net:301重定向_Asp.net_Iis_Web Config - Fatal编程技术网

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重写提供了同等的功能,但一般说来更易于配置(取决于您对正则表达式等的熟悉程度)。首先尝试一下,您会发现您当前的配置(依赖于位置标记)不够灵活。