2015-09-13 31 views
0

好的,我有一个运行在iis-7.5上的.net网站,我的表单是从数据库内容构建的。我们有一个已经构建的表单,并附有答案,并且希望替换表单但不删除旧表单,因此我们创建了一个新表单,现在我的问题是我有一个问题将用户从该表单重定向到新表单。这里是我在web.config文件中。并尝试基于{QUERY_STRING}进行重定向,但这种方法并不适用,旧的URL仍处于活动状态。任何帮助,将不胜感激aspx动态数据重定向

<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> 
+0

IIS 6.1?哪有这回事。您的服务器运行的是哪个版本的Windows? – Kev

+0

Windows Web Server 2008 R2和更新发布您正确的是iis-7.5 –

回答

0

确定这里是我做过什么,它的伟大工程。

我删除从公式域,并添加redirectType =“发现”所以基本上必须使用文件夹重定向与{} 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>