aspx动态数据重定向

aspx dynamic data redirect

好的,我在 iis-7.5 上有一个 .net 站点 运行,我的表单是根据数据库内容构建的。我们有一个已构建的表单并附有答案并且想要替换表单但不删除旧表单所以我们创建了一个新表单,现在我的问题是我在将用户从该表单重定向到新表单时遇到问题.这是我在 web.config 文件中的内容。并尝试基于 {QUERY_STRING} 进行重定向,但这并不能正常工作,旧的 URL 仍然有效。任何帮助将不胜感激

<rewrite>

      <rules>
        <rule name="Redirect" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^http://www.oursite.com/service/ReportData\.aspx$" />
          <conditions>
                        <add input="{QUERY_STRING}" pattern="^header=1393$" />
          </conditions>
          <action type="Redirect" url="http://www.oursite.com/service/ReportData.aspx?header=1395{R:0}" appendQueryString="false" />

        </rule>

    </rules>
    </rewrite> 

编辑 2:

好的,这就是我所做的,效果很好。

我从等式中删除了域并添加了 redirectType="Found" 所以基本上你必须使用文件夹进行重定向 {QUERY_STRING}

<rules>
        <rule name="Redirect" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^service/ReportData\.aspx$" />

          <action type="Redirect" url="service/ReportData.aspx?header=1395" appendQueryString="false" redirectType="Found" />

          <conditions>
                        <add input="{QUERY_STRING}" pattern="^header=1393$" />
          </conditions>

        </rule>

好的,这就是我所做的,效果很好。

我从等式中删除了域并添加了 redirectType="Found" 所以基本上你必须使用带有 {QUERY_STRING}

的文件夹进行重定向
<rules>
        <rule name="Redirect" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^service/ReportData\.aspx$" />

          <action type="Redirect" url="service/ReportData.aspx?header=1395" appendQueryString="false" redirectType="Found" />

          <conditions>
                        <add input="{QUERY_STRING}" pattern="^header=1393$" />
          </conditions>

        </rule>