最初に要求された URL にクエリ文字列が存在することに基づいて、web.config を使用してリダイレクトすることは可能ですか? 条件に何を入れたらいいのかわからない。私は web.config で書き換え/リダイレクト ルールを操作する初心者であり、構文、パラメーターなどについて詳しく知りたいと考えています。
私はこのようなことをしようとしています:
<rewrite>
<rules>
<rule name="Restricted Folder with Querystring" stopProcessing="true">
<match url="^test folder/(.*)" ignoreCase="false" />
<conditions>
<!--redirect to a certain page if a certain querystring is present -->
</conditions>
<action type="Redirect" redirectType="Permanent" url="/test folder/{R:1}" />
</rule>
<rule name="Restricted Folder without Querystring" stopProcessing="true">
<match url="^test folder/(.*)" ignoreCase="false" />
<conditions>
<!--redirect to another page if querystring is not present -->
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://www.whatever.com/page.asp?url={R:1}" />
</rule>
</rules>
</rewrite>