2017-08-28 8 views
0

私はこのパターンを使用して書き換えモジュールを使用して、紺碧のウェブサイト上で永続的にリダイレクトをしようとgetを使用して:Azureのサーバーリダイレクトモジュールパラメータ

<rule name="Rewrite redirect-not-found-products-w" patternSyntax="ExactMatch" stopProcessing="true"> 
     <match url="product/Product.aspx?product_id=287"/> 
     <action type="Redirect" url="https://example.com/product" redirectType="Permanent"/> 
    </rule> 

をしかし、私はGETパラメータ

によっての世話をしたいと思います例では、リダイレクト:

example.com/product/Product.aspx?product_id=287

または

example.com/product/Product.aspx?product_id=35

Product.aspx/example.com/product

ではなく、製品全体

答えて

1

ルールにクエリ文字列を含む条件が必要です。クエリ文字列を使用することはできません。match url=

<rule name="Rewrite redirect-not-found-products-w" stopProcessing="true"> 
    <match url="^product/Product.aspx$" />  
    <conditions logicalGrouping="MatchAny"> 
     <add input="{QUERY_STRING}" pattern="^product_id=287$" /> 
     <add input="{QUERY_STRING}" pattern="^product_id=35$" /> 
    </conditions> 
    <action type="Redirect" url="https://example.com/product" redirectType="Permanent" /> 
</rule> 

ルールは、上記のリダイレクトします:

または

example.com/product/Product.aspx?product_id=35

example.com/product/Product.aspx?product_id=287を

example.com/product

関連する問題