question

hhzz-2205 avatar image
0 Votes"
hhzz-2205 asked SamWu-MSFT answered

redirect problem

I want to create a rule that satisfies the following two urls to redirect at the same time.

mydomain.com/test1 -> mydomain.com/index.html

mydomain.com/test1/test2 -> mydomain.com/index.html

note: test1 and test1/test2 are dynamic

windows-server-iis
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SamWu-MSFT avatar image
0 Votes"
SamWu-MSFT answered

@hhzz-2205

You can use the following case as a reference:

 <rule name="test" stopProcessing="true">          
      <match url="(.*)" />
            <conditions>
                  <add input="{REQUEST_URI}" pattern="^/([^/]+)" />
            </conditions>
      <action type="Redirect" url="http://mydomain.com/{C:1}/index.com" redirectType="Found" />
 </rule>

If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.