question

afflifgsdhjs-3720 avatar image
0 Votes"
afflifgsdhjs-3720 asked SamWu-MSFT edited

How to capture parts of my domain into subdirectory

I want to redirect below url, can anyone help me move my domain name to a subdirectory?

http://www.support.example.com to http://www.example.com/support

Any suggestions are great!

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 SamWu-MSFT edited

@afflifgsdhjs-3720

You can try this rule:

 <rule name="Test" stopProcessing="true">
        <match url=".*" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^www.(.*)\.example\.com$" />
            </conditions>
         <action type="Redirect" url="http://www.example.com/{C:1}/" />
  </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.