2012-05-14 14 views
0

私たちのサイトをphp apacheサイトからasp.net mvcサイトに移動しました。特定のリダイレクトを取得しようとしていますが、止まっています。特定のページをiis web.configの別の特定のページにリダイレクトする

基本的に私は、私はこれを試してみたが、それは動作しませんhttp://www.mysite.com/About-Us

にリダイレクトするhttp://www.mysite.com/index.php?pr=about_usのためのすべての要求をしたいです。何か案は?

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

さまざまなページに実装する必要があるこれらのリダイレクトが約1ダースあります。

ご協力いただきありがとうございます。これは、条件のための別の可能性である

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

編集

: おかげ

答えて

2

は、このいずれかを試してみてください

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

編集 - 作業溶液

<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> 
関連する問題