Redirect 将特定页面重定向到iis web.config中的另一个特定页面

Redirect 将特定页面重定向到iis web.config中的另一个特定页面,redirect,web-config,Redirect,Web Config,我们已经将我们的站点从一个php apache站点移到了一个asp.net mvc站点,我正试图获得特定的重定向来工作,但是我被卡住了 基本上,我希望任何请求被重定向到 我试过这个,但不起作用。有什么想法吗 <rewrite> <rules> <rule name="About Us" stopProcessing="true"> <match url="index.php?pr=About_Us" ignoreCase="fal

我们已经将我们的站点从一个php apache站点移到了一个asp.net mvc站点,我正试图获得特定的重定向来工作,但是我被卡住了

基本上,我希望任何请求被重定向到

我试过这个,但不起作用。有什么想法吗

<rewrite>
  <rules>
    <rule name="About Us" stopProcessing="true">
      <match url="index.php?pr=About_Us" ignoreCase="false" />
      <action type="Redirect" redirectType="Permanent" url="http://www.mysite.com/About-Us" />
    </rule>
  </rules>
</rewrite>

我也试过,但也没用

<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Permanent">
    <add wildcard="index.php?pr=About_Us" destination="/About-Us" />
</httpRedirect>

我有十几个这样的特定重定向,我需要实现到不同的页面

非常感谢您的帮助! 谢谢

试试这个:

<rule name="About Us" stopProcessing="true">
    <match url="^(.*)$">
        <conditions>
            <add input="{URL}" pattern="index.php?pr=About_Us" />
        </conditions>
    </match>
    <action type="Redirect" redirectType="Permanent" url="http://www.mysite.com/About-Us" />
</rule>

编辑

这是条件的另一种可能性:

<conditions logicalGrouping="MatchAll">
    <add input="{QUERY_STRING}" pattern="?pr=About_Us" />
    <add input="{REQUEST_FILENAME}" pattern="index.php" />
</conditions>

编辑-工作解决方案


这在web.config中的位置是什么?在system.webserver部分下?
<rule name="About Us" stopProcessing="true">
  <match url="^(.*)$" />
    <conditions logicalGrouping="MatchAll">
      <add input="{QUERY_STRING}" pattern="/?pr=About_Us$" />
      <add input="{REQUEST_FILENAME}" pattern="index.php" />
    </conditions>
    <action type="Redirect" redirectType="Permanent" url="http://www.mysite.com/About-Us" />
</rule>